android.transition.AutoTransition Java Examples

The following examples show how to use android.transition.AutoTransition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CoverActivity.java    From GyroscopeImageDemo with Apache License 2.0 6 votes vote down vote up
/**
 * 模拟入场动画
 */
private void runEnterAnim() {
  getScreenSize();
  mIvCover.post(new Runnable() {
    @Override public void run() {
      FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(mScreenWidth, mScreenHeight);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ChangeImageTransform changeImageTransform = new ChangeImageTransform();
        AutoTransition autoTransition = new AutoTransition();
        changeImageTransform.setDuration(TRANSITIONS_DURATION);
        autoTransition.setDuration(TRANSITIONS_DURATION);
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(autoTransition);
        transitionSet.addTransition(changeImageTransform);
        TransitionManager.beginDelayedTransition(mTransitionsContainer, transitionSet);
        mIvCover.setLayoutParams(params);
        mIvCover.setScaleType(ImageView.ScaleType.CENTER_CROP);
      } else {
        mIvCover.setLayoutParams(params);
        mIvCover.setScaleType(ImageView.ScaleType.CENTER_CROP);
      }
    }
  });
}
 
Example #2
Source File: SharedElementLaunchedActivity.java    From PhotoDraweeView with Apache License 2.0 6 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void initWindowTransitions() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        AutoTransition transition = new AutoTransition();
        getWindow().setSharedElementEnterTransition(transition);
        getWindow().setSharedElementExitTransition(transition);
        ActivityCompat.setEnterSharedElementCallback(this, new SharedElementCallback() {
            @Override public void onSharedElementEnd(List<String> sharedElementNames,
                    List<View> sharedElements, List<View> sharedElementSnapshots) {
                for (final View view : sharedElements) {
                    if (view instanceof PhotoDraweeView) {
                        ((PhotoDraweeView) view).setScale(1f, true);
                    }
                }
            }
        });
    }
}
 
Example #3
Source File: ContactDetailActivity.java    From CrazyDaily with Apache License 2.0 5 votes vote down vote up
private void initTransition() {
    Window window = getWindow();
    TransitionSet set = new TransitionSet();

    AutoTransition autoTransition = new AutoTransition();
    autoTransition.excludeTarget(R.id.ic_head, true);
    autoTransition.addTarget(R.id.tx_name);
    autoTransition.addTarget(R.id.ic_location);
    autoTransition.addTarget(R.id.tx_location);
    autoTransition.setDuration(600);
    autoTransition.setInterpolator(new DecelerateInterpolator());
    set.addTransition(autoTransition);

    BezierTransition bezierTransition = new BezierTransition();
    bezierTransition.addTarget(R.id.ic_head);
    bezierTransition.excludeTarget(R.id.tx_name, true);
    bezierTransition.excludeTarget(R.id.ic_location, true);
    bezierTransition.excludeTarget(R.id.tx_location, true);
    bezierTransition.setDuration(600);
    bezierTransition.setInterpolator(new DecelerateInterpolator());
    set.addTransition(bezierTransition);

    CircularRevealTransition transition = new CircularRevealTransition();
    transition.excludeTarget(android.R.id.statusBarBackground, true);
    window.setEnterTransition(transition);
    window.setReenterTransition(transition);
    window.setReturnTransition(transition);
    window.setExitTransition(transition);

    window.setSharedElementEnterTransition(set);
    window.setSharedElementReturnTransition(set);

}
 
Example #4
Source File: BottomNavigationAnimationHelperKitkat.java    From MiPushFramework with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: PostActivity.java    From materialup with Apache License 2.0 5 votes vote down vote up
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));
    }
}
 
Example #6
Source File: ContentActivity.java    From ticdesign with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #7
Source File: FadeOutTransition.java    From Material-SearchTransition with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example #8
Source File: FadeInTransition.java    From Material-SearchTransition with MIT License 4 votes vote down vote up
public static Transition createTransition() {
    AutoTransition transition = new AutoTransition();
    transition.setDuration(FADE_IN_DURATION);
    return transition;
}
 
Example #9
Source File: TransitionHelperKitkat.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
static Object createAutoTransition() {
    return new AutoTransition();
}