Example usage for android.transition ArcMotion setMinimumHorizontalAngle

List of usage examples for android.transition ArcMotion setMinimumHorizontalAngle

Introduction

In this page you can find the example usage for android.transition ArcMotion setMinimumHorizontalAngle.

Prototype

public void setMinimumHorizontalAngle(float angleInDegrees) 

Source Link

Document

Sets the minimum arc along the circle between two points aligned near horizontally.

Usage

From source file:io.github.prefanatic.cleantap.ui.animation.InfoAndCheckinAnimation.java

public static void setupSharedElementTransitionsFab(@NonNull Activity activity, @Nullable View target,
        int dialogCornerRadius) {
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);
    int color = ContextCompat.getColor(activity, R.color.colorAccent);
    Interpolator easeInOut = AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in);
    MorphFabToDialog sharedEnter = new MorphFabToDialog(color, dialogCornerRadius);
    sharedEnter.setPathMotion(arcMotion);
    sharedEnter.setInterpolator(easeInOut);
    MorphDialogToFab sharedReturn = new MorphDialogToFab(color);
    sharedReturn.setPathMotion(arcMotion);
    sharedReturn.setInterpolator(easeInOut);
    if (target != null) {
        sharedEnter.addTarget(target);//from w  ww  .jav  a2 s  .  co m
        sharedReturn.addTarget(target);
    }
    activity.getWindow().setSharedElementEnterTransition(sharedEnter);
    activity.getWindow().setSharedElementReturnTransition(sharedReturn);
}

From source file:org.huxizhijian.hhcomicviewer.ui.entry.ComicDetailsActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setMotion() {
    // Activity Shared Element?
    //ArcMotion//from  w ww  .j  av a 2s  .  c om
    ArcMotion arcMotion = new ArcMotion();
    arcMotion.setMinimumHorizontalAngle(50f);
    arcMotion.setMinimumVerticalAngle(50f);
    //?
    Interpolator interpolator = AnimationUtils.loadInterpolator(this, android.R.interpolator.fast_out_slow_in);
    //ChangeBounds
    CustomChangeBounds changeBounds = new CustomChangeBounds();
    changeBounds.setPathMotion(arcMotion);
    changeBounds.setInterpolator(interpolator);
    changeBounds.addTarget(mBinding.comicThumbnailComicDetails);
    //??Activity
    getWindow().setSharedElementEnterTransition(changeBounds);
    getWindow().setSharedElementReturnTransition(changeBounds);
}