/** * {@link TransitionManager#beginDelayedTransition(ViewGroup) Begin a delayed transition} if * one is not already running. */ @UiThread public static void tryDelayed(ViewGroup sceneRoot) { if (!sceneRoot.isLaidOut()) { // transition won't run return; } if (sDelayedTransition == null) { sDelayedTransition = new AutoTransition().addListener(new SimpleTransitionListener() { @Override public void onTransitionEnd(Transition transition) { super.onTransitionEnd(transition); sDelayedTransitionRunning = false; } }); } if (!sDelayedTransitionRunning) { sDelayedTransitionRunning = true; TransitionManager.beginDelayedTransition(sceneRoot, sDelayedTransition); } }
void updateLinkText(String link) { linkTextView.setText(link); Transition transition = new AutoTransition() .setDuration(500) .setStartDelay(300) .setInterpolator(new AccelerateDecelerateInterpolator()); TransitionManager.beginDelayedTransition(rootView, transition); linkTextView.setVisibility(View.VISIBLE); }
BottomNavigationAnimationHelperKitkat() { mSet = new AutoTransition(); mSet.setOrdering(TransitionSet.ORDERING_TOGETHER); mSet.setDuration(ACTIVE_ANIMATION_DURATION_MS); mSet.setInterpolator(new FastOutSlowInInterpolator()); TextScale textScale = new TextScale(); mSet.addTransition(textScale); }
public DribbbleCommentsAdapter(Context context, int resource, List<Comment> comments) { super(context, resource, comments); inflater = LayoutInflater.from(context); if (UI.isLollipop()) { change = new AutoTransition(); change.setDuration(200L); change.setInterpolator(AnimationUtils.loadInterpolator(context, android.R.interpolator.fast_out_slow_in)); } }
@Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setSharedElementEnterTransition(new AutoTransition()); // Because we are loading things async, these are really just for exit animations. setEnterTransition(new TransitionSet() .addTransition(new AnchorAppBarSlide(R.id.app_bar).addTarget(R.id.types)) .addTransition(new SlideDownAndFadeOut().addTarget(R.id.content))); }
public DribbbleCommentsAdapter(Context context, int resource, List<Comment> comments) { super(context, resource, comments); inflater = LayoutInflater.from(context); change = new AutoTransition(); change.setDuration(200L); change.setInterpolator(getFastOutSlowInInterpolator(context)); }
@SuppressWarnings("unused") @OnClick(R.id.image_avatar) protected void onChangeCheese() { int iconRes = Cheeses.getRandomCheeseDrawable(); String titleString = Cheeses.getRandomCheeseString(); TransitionManager.beginDelayedTransition(layoutContainer, new AutoTransition()); imageAvatar.setImageResource(iconRes); textTitle.setText(titleString); colorize(((BitmapDrawable) imageAvatar.getDrawable()).getBitmap()); }
/** * Creates a AutoTransition that calls the {@linkplain android.transition.Transition.TransitionListener#onTransitionEnd(Transition)} * of the passing Listener when complete */ public static Transition withAction(TransitionListener finishingAction) { AutoTransition transition = new AutoTransition(); transition.setDuration(FADE_OUT_DURATION); transition.addListener(finishingAction); return transition; }
public static Transition createTransition() { AutoTransition transition = new AutoTransition(); transition.setDuration(FADE_IN_DURATION); return transition; }
public static Transition withAction(TransitionListener finishingAction) { AutoTransition transition = new AutoTransition(); transition.setDuration(FADE_OUT_DURATION); transition.addListener(finishingAction); return transition; }
static Object createAutoTransition() { return new AutoTransition(); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.transitions_xml_frag, null); ButterKnife.inject(this, view); mSceneRoot = ButterKnife.findById(view, R.id.transitions_xml_scene_root); // Inflate some scenes directly from XML mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_xml_scene1, getActivity()); mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_xml_scene2, getActivity()); // Create a Scene from a ViewGroup that already exists LinearLayout scene3Layout = (LinearLayout) inflater.inflate(R.layout.transition_xml_scene3, null); mScene3 = new Scene(mSceneRoot, scene3Layout); // Can modify Scene 3's underlying behavior by adding a click listener scene3Layout.findViewById(R.id.transition_xml_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getActivity(), "Android Levl=100", Toast.LENGTH_SHORT).show(); } }); mTransitionManager = new TransitionManager(); mTransitionManager.setTransition( mScene1, mScene2, new ChangeBounds() ); mTransitionManager.setTransition( mScene2, mScene1, new Fade() ); mTransitionManager.setTransition( mScene2, mScene3, new AutoTransition() ); return view; }