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

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

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

Transition.excludeTarget介绍

暂无

代码示例

代码示例来源:origin: DroidsOnRoids/Workcation

public TransitionBuilder excludeTarget(final View view, final boolean exclude){
  transition.excludeTarget(view, exclude);
  return this;
}

代码示例来源:origin: DroidsOnRoids/Workcation

public TransitionBuilder excludeTarget(final String targetName, final boolean exclude) {
  transition.excludeTarget(targetName, exclude);
  return this;
}

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

public static void excludeTarget(Object transitionObject, View view, boolean exclude) {
  Transition transition = (Transition) transitionObject;
  transition.excludeTarget(view, exclude);
}

代码示例来源:origin: stackoverflow.com

public static Transition makeEnterTransition() {
  Transition fade = new Fade();
  fade.excludeTarget(android.R.id.navigationBarBackground, true);
  fade.excludeTarget(android.R.id.statusBarBackground, true);
  return fade;
}

代码示例来源:origin: stackoverflow.com

// above I've gotten the sharedElements (Views)...
     newSharedElement.setTransitionName("sharedProperty");
     oldSharedElement.setTransitionName("sharedProperty");
     // having android:transitionName in the xml can be easier
     // This transition handles the shared element move based on the shared tansition name
     Transition shared = TransitionInflater.from(context).inflateTransition(android.R.transition.move);
     shared.addTarget(newSharedElement);
     // create a scene container is a parentView (FrameLayout) of both children
     Scene scene = new Scene(container, newChild);
     // everything else is set to Fade, shared element is excluded
     Transition fade = TransitionInflater.from(context).inflateTransition(android.R.transition.fade);
     fade.excludeTarget(newSharedElement, true);
     // combine the translations
     TransitionSet set = new TransitionSet();
     set.addTransition(shared).addTransition(fade);
     // translationize
     TransitionManager.go(scene, set);

代码示例来源:origin: jonasbleyl/recurrence

@Override
  public void onClick(View view) {
    Intent intent = new Intent(context, ViewActivity.class);
    intent.putExtra("NOTIFICATION_ID", reminderList.get(viewHolder.getAdapterPosition()).getId());
    // Add shared element transition animation if on Lollipop or later
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      CardView cardView = (CardView) view.findViewById(R.id.notification_card);
      TransitionSet setExit = new TransitionSet();
      Transition transition = new Fade();
      transition.excludeTarget(android.R.id.statusBarBackground, true);
      transition.excludeTarget(android.R.id.navigationBarBackground, true);
      transition.excludeTarget(R.id.fab_button, true);
      transition.excludeTarget(R.id.recycler_view, true);
      transition.setDuration(400);
      setExit.addTransition(transition);
      ((Activity) context).getWindow().setSharedElementsUseOverlay(false);
      ((Activity) context).getWindow().setReenterTransition(null);
      ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(((Activity) context), cardView, "cardTransition");
      ActivityCompat.startActivity(((Activity) context), intent, options.toBundle());
      ((RecyclerListener) context).hideFab();
    } else {
      context.startActivity(intent);
    }
  }
});

代码示例来源:origin: codeka/wwmmo

for (SharedViews.SharedView sharedView : sharedViews.getSharedViews()) {
 if (sharedView.getViewId() != 0) {
  fadeTransition.excludeTarget(sharedView.getViewId(), true);
  transformTransition.addTarget(sharedView.getViewId());
 } else {
   log.error("Unexpected SharedView configuration.");
  fadeTransition.excludeTarget(name, true);
  transformTransition.addTarget(name);

代码示例来源:origin: jonasbleyl/recurrence

public void setupTransitions() {
  // Add shared element transition animation if on Lollipop or later
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    // Enter transitions
    TransitionSet setEnter = new TransitionSet();
    Transition slideDown = new Explode();
    slideDown.addTarget(headerView);
    slideDown.excludeTarget(scrollView, true);
    slideDown.setDuration(500);
    setEnter.addTransition(slideDown);
    Transition fadeOut = new Slide(Gravity.BOTTOM);
    fadeOut.addTarget(scrollView);
    fadeOut.setDuration(500);
    setEnter.addTransition(fadeOut);
    // Exit transitions
    TransitionSet setExit = new TransitionSet();
    Transition slideDown2 = new Explode();
    slideDown2.addTarget(headerView);
    slideDown2.setDuration(570);
    setExit.addTransition(slideDown2);
    Transition fadeOut2 = new Slide(Gravity.BOTTOM);
    fadeOut2.addTarget(scrollView);
    fadeOut2.setDuration(280);
    setExit.addTransition(fadeOut2);
    getWindow().setEnterTransition(setEnter);
    getWindow().setReturnTransition(setExit);
  }
}

相关文章