use of com.hitherejoe.animate.util.MorphButtonToDialog in project animate by hitherejoe.
the class PopupActivity method setupSharedElementTransitionsButton.
public void setupSharedElementTransitionsButton(@NonNull Activity activity, @Nullable View target) {
ArcMotion arcMotion = new ArcMotion();
arcMotion.setMinimumHorizontalAngle(50f);
arcMotion.setMinimumVerticalAngle(50f);
int color = ContextCompat.getColor(activity, R.color.accent);
Interpolator easeInOut = AnimationUtils.loadInterpolator(activity, android.R.interpolator.fast_out_slow_in);
MorphButtonToDialog sharedEnter = new MorphButtonToDialog(color);
sharedEnter.setPathMotion(arcMotion);
sharedEnter.setInterpolator(easeInOut);
MorphDialogToButton sharedReturn = new MorphDialogToButton(color);
sharedReturn.setPathMotion(arcMotion);
sharedReturn.setInterpolator(easeInOut);
if (target != null) {
sharedEnter.addTarget(target);
sharedReturn.addTarget(target);
}
activity.getWindow().setSharedElementEnterTransition(sharedEnter);
activity.getWindow().setSharedElementReturnTransition(sharedReturn);
}
Aggregations