use of android.transition.ArcMotion in project Conductor by bluelinelabs.
the class ArcFadeMoveChangeHandler method getTransition.
@Override
@NonNull
protected Transition getTransition(@NonNull ViewGroup container, View from, View to, boolean isPush) {
TransitionSet transition = new TransitionSet().setOrdering(TransitionSet.ORDERING_SEQUENTIAL).addTransition(new Fade(Fade.OUT)).addTransition(new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform())).addTransition(new Fade(Fade.IN));
transition.setPathMotion(new ArcMotion());
return transition;
}
use of android.transition.ArcMotion 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);
}
use of android.transition.ArcMotion in project animate by hitherejoe.
the class PopupActivity method setupSharedElementTransitionsFab.
public 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.accent);
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);
sharedReturn.addTarget(target);
}
activity.getWindow().setSharedElementEnterTransition(sharedEnter);
activity.getWindow().setSharedElementReturnTransition(sharedReturn);
}
use of android.transition.ArcMotion in project CloudReader by youlookwhat.
the class BaseHeaderActivity method setMotion.
/**
* 设置自定义 Shared Element切换动画
* 默认不开启曲线路径切换动画,
* 开启需要重写setHeaderPicView(),和调用此方法并将isShow值设为true
*
* @param imageView 共享的图片
* @param isShow 是否显示曲线动画
*/
protected void setMotion(ImageView imageView, boolean isShow) {
if (!isShow) {
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//定义ArcMotion
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(imageView);
//将切换动画应用到当前的Activity的进入和返回
getWindow().setSharedElementEnterTransition(changeBounds);
getWindow().setSharedElementReturnTransition(changeBounds);
}
}
Aggregations