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

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

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

Transition.removeTarget介绍

暂无

代码示例

代码示例来源:origin: bluelinelabs/Conductor

@Override
  public void run() {
    if (enterTransition != null) {
      enterTransition.removeTarget(nonExistentView);
      List<View> views = configureEnteringExitingViews(enterTransition, to, toSharedElements, nonExistentView);
      enteringViews.addAll(views);
    }
    if (exitingViews != null) {
      if (exitTransition != null) {
        List<View> tempExiting = new ArrayList<>();
        tempExiting.add(nonExistentView);
        TransitionUtils.replaceTargets(exitTransition, exitingViews, tempExiting);
      }
      exitingViews.clear();
      exitingViews.add(nonExistentView);
    }
  }
});

代码示例来源:origin: bluelinelabs/Conductor

public static void replaceTargets(@NonNull Transition transition, @NonNull List<View> oldTargets, @Nullable List<View> newTargets) {
  if (transition instanceof TransitionSet) {
    TransitionSet set = (TransitionSet) transition;
    int numTransitions = set.getTransitionCount();
    for (int i = 0; i < numTransitions; i++) {
      Transition child = set.getTransitionAt(i);
      replaceTargets(child, oldTargets, newTargets);
    }
  } else if (!TransitionUtils.hasSimpleTarget(transition)) {
    List<View> targets = transition.getTargets();
    if (targets != null && targets.size() == oldTargets.size() && targets.containsAll(oldTargets)) {
      final int targetCount = newTargets == null ? 0 : newTargets.size();
      for (int i = 0; i < targetCount; i++) {
        transition.addTarget(newTargets.get(i));
      }
      for (int i = oldTargets.size() - 1; i >= 0; i--) {
        transition.removeTarget(oldTargets.get(i));
      }
    }
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static void removeTargets(Object transitionObject, ArrayList<View> views) {
  Transition transition = (Transition) transitionObject;
  int numViews = views.size();
  for (int i = 0; i < numViews; i++) {
    transition.removeTarget(views.get(i));
  }
}

相关文章