本文整理了Java中android.transition.Transition.clone()
方法的一些代码示例,展示了Transition.clone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transition.clone()
方法的具体详情如下:
包路径:android.transition.Transition
类名称:Transition
方法名:clone
暂无
代码示例来源:origin: kingargyle/adt-leanback-support
public static Object cloneTransition(Object transition) {
if (transition != null) {
transition = ((Transition)transition).clone();
}
return transition;
}
代码示例来源:origin: stackoverflow.com
private static Transition sDefaultTransition = new AutoTransition();
....
public static void More ...beginDelayedTransition(final ViewGroup sceneRoot, Transition transition) {
if (!sPendingTransitions.contains(sceneRoot) && sceneRoot.isLaidOut()) {
if (Transition.DBG) {
Log.d(LOG_TAG, "beginDelayedTransition: root, transition = " +
sceneRoot + ", " + transition);
}
sPendingTransitions.add(sceneRoot);
if (transition == null) {
transition = sDefaultTransition;
}
final Transition transitionClone = transition.clone();
sceneChangeSetup(sceneRoot, transitionClone);
Scene.setCurrentScene(sceneRoot, null);
sceneChangeRunTransition(sceneRoot, transitionClone);
}
}
代码示例来源:origin: consp1racy/android-support-preference
@SuppressLint({"RestrictedApi", "ResourceType"})
private void init(
@NonNull Context context,
@Nullable AttributeSet attrs,
@AttrRes int defStyleAttr,
@StyleRes int defStyleRes) {
if (Build.VERSION.SDK_INT == 23) {
final TypedArray a = context.obtainStyledAttributes(attrs, ATTRS, defStyleAttr, defStyleRes);
try {
final Transition enterTransition = getTransition(a.getResourceId(0, 0));
final Transition exitTransition;
if (a.hasValueOrEmpty(1)) {
exitTransition = getTransition(a.getResourceId(1, 0));
} else {
exitTransition = enterTransition == null ? null : enterTransition.clone();
}
setEnterTransition(enterTransition);
setExitTransition(exitTransition);
} finally {
a.recycle();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!