本文整理了Java中android.support.v4.app.Fragment.setReenterTransition()
方法的一些代码示例,展示了Fragment.setReenterTransition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.setReenterTransition()
方法的具体详情如下:
包路径:android.support.v4.app.Fragment
类名称:Fragment
方法名:setReenterTransition
[英]Sets the Transition that will be used to move Views in to the scene when returning due to popping a back stack. The entering Views will be those that are regular Views or ViewGroups that have ViewGroup#isTransitionGroup return true. Typical Transitions will extend android.transition.Visibility as exiting is governed by changing visibility from View#VISIBLE to View#INVISIBLE. If transition is null, the views will remain unaffected. If nothing is set, the default will be to use the same transition as #setExitTransition(Object).
[中]设置由于弹出后堆栈而返回时用于将视图移入场景的过渡。输入的视图将是常规视图或ViewGroup,ViewGroup#isTransitionGroup返回true。典型的转换将扩展android。过渡退出时的可见性由从视图#可见到视图#不可见更改可见性来控制。如果transition为null,视图将保持不变。如果未设置任何内容,默认情况下将使用与#setExitTransition(对象)相同的转换。
代码示例来源:origin: com.albedinsky.android.support/support-fragments
/**
* @see #setReenterTransition(int)
*/
@Override
public void setReenterTransition(Object transition) {
super.setReenterTransition(transition);
}
代码示例来源:origin: xbmc/Kore
/**
* Sets up the transition for the exiting fragment
* @param fragment
*/
@TargetApi(21)
public void setupExitTransition(Context context, Fragment fragment) {
Transition fade = TransitionInflater
.from(context)
.inflateTransition(android.R.transition.fade);
fragment.setExitTransition(fade);
fragment.setReenterTransition(fade);
fragment.setExitSharedElementCallback(new SharedElementCallback() {
@Override
public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) {
// Clearing must be done in the reentering fragment
// as this is called last. Otherwise, the app will crash during transition setup. Not sure, but might
// be a v4 support package bug.
if (clearSharedElements) {
names.clear();
sharedElements.clear();
clearSharedElements = false;
}
}
});
}
代码示例来源:origin: xbmc/Kore
fragment.setReenterTransition(TransitionInflater
.from(this)
.inflateTransition(android.R.transition.fade));
代码示例来源:origin: com.albedinsky.android.support/support-fragments
fragment.setReenterTransition(options.mReenterTransition);
内容来源于网络,如有侵权,请联系作者删除!