use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method startScaleAnimationFromPivot.
public static void startScaleAnimationFromPivot(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
v.setScaleY(SCALE_START_ANCHOR);
v.setPivotX(pivotX);
v.setPivotY(pivotY);
v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
v.getViewTreeObserver().removeOnPreDrawListener(this);
ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).scaleX(1).setDuration(SCALE_DELAY);
if (animatorListener != null)
viewPropertyAnimator.setListener(animatorListener);
viewPropertyAnimator.start();
return true;
}
});
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method showViewByScale.
public static ViewPropertyAnimator showViewByScale(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(1).scaleX(1);
propertyAnimator.setListener(animatorListener);
return propertyAnimator;
}
use of android.view.ViewPropertyAnimator in project Material-Movies by saulmm.
the class GUIUtils method hideViewByScaleY.
public static ViewPropertyAnimator hideViewByScaleY(View v, AnimatorListener animatorListener) {
ViewPropertyAnimator propertyAnimator = v.animate().setStartDelay(SCALE_DELAY).scaleY(0);
propertyAnimator.setListener(animatorListener);
return propertyAnimator;
}
use of android.view.ViewPropertyAnimator in project Android-Material-Examples by saulmm.
the class TransitionSecondActivity method onBackPressed.
@Override
public void onBackPressed() {
for (int i = 0; i < rowContainer.getChildCount(); i++) {
View rowView = rowContainer.getChildAt(i);
ViewPropertyAnimator propertyAnimator = rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(0).scaleY(0).setListener(new AnimatorAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
finishAfterTransition();
}
});
}
}
use of android.view.ViewPropertyAnimator in project vlayout by alibaba.
the class FixLayoutHelper method removeFixViewWithAnimator.
private void removeFixViewWithAnimator(RecyclerView.Recycler recycler, LayoutManagerHelper layoutManagerHelper, View fixView) {
if (!isRemoveFixViewImmediately && mFixViewAnimatorHelper != null) {
ViewPropertyAnimator animator = mFixViewAnimatorHelper.onGetFixViewDisappearAnimator(fixView);
if (animator != null) {
mFixViewDisappearAnimatorListener.bindAction(recycler, layoutManagerHelper, fixView);
animator.setListener(mFixViewDisappearAnimatorListener).start();
isAddFixViewImmediately = false;
} else {
layoutManagerHelper.removeChildView(fixView);
recycler.recycleView(fixView);
isAddFixViewImmediately = false;
}
} else {
layoutManagerHelper.removeChildView(fixView);
recycler.recycleView(fixView);
isAddFixViewImmediately = false;
}
}
Aggregations