android.transition.Transition.clone()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中android.transition.Transition.clone()方法的一些代码示例,展示了Transition.clone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transition.clone()方法的具体详情如下:
包路径:android.transition.Transition
类名称:Transition
方法名:clone

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();
    }
  }
}

相关文章