use of android.animation.AnimatorListenerAdapter in project mortar by square.
the class SimplePathContainer method runAnimation.
private void runAnimation(final ViewGroup container, final View from, final View to, Flow.Direction direction, final Flow.TraversalCallback callback) {
Animator animator = createSegue(from, to, direction);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
container.removeView(from);
callback.onTraversalCompleted();
}
});
animator.start();
}
use of android.animation.AnimatorListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class AnimProcessor method animHeadHideByVy.
/**
* 5.当刷新处于可见状态,向上滑动屏幕时,隐藏刷新控件
*
* @param vy 手指向上滑动速度
*/
public void animHeadHideByVy(int vy) {
isAnimHeadHide = true;
cp.onRefreshCanceled();
vy = Math.abs(vy);
if (vy < 5000)
vy = 8000;
animLayoutByTime(getVisibleHeadHeight(), 0, 5 * Math.abs(getVisibleHeadHeight() * 1000 / vy), animHeadUpListener, new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isAnimHeadHide = false;
cp.resetHeaderView();
}
});
}
use of android.animation.AnimatorListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class AnimProcessor method animBottomHideByVy.
/**
* 6.当加载更多处于可见状态时,向下滑动屏幕,隐藏加载更多控件
*
* @param vy 手指向下滑动的速度
*/
public void animBottomHideByVy(int vy) {
isAnimBottomHide = true;
cp.onLoadmoreCanceled();
vy = Math.abs(vy);
if (vy < 5000)
vy = 8000;
animLayoutByTime(getVisibleFootHeight(), 0, 5 * getVisibleFootHeight() * 1000 / vy, animBottomUpListener, new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isAnimBottomHide = false;
cp.resetBottomView();
}
});
}
use of android.animation.AnimatorListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class AnimProcessor method animOverScrollBottom.
/**
* 8.执行底部越界
*
* @param vy 满足越界条件的手指滑动速度
* @param computeTimes 从满足条件到滚动到顶部总共计算的次数
*/
public void animOverScrollBottom(float vy, int computeTimes) {
if (isOverScrollBottomLocked)
return;
cp.setStatePBU();
int oh = (int) Math.abs(vy / computeTimes / 2);
final int overHeight = oh > cp.getOsHeight() ? cp.getOsHeight() : oh;
final int time = overHeight <= 50 ? 115 : (int) (0.3 * overHeight + 100);
if (cp.autoLoadMore()) {
cp.startLoadMore();
} else {
isOverScrollBottomLocked = true;
isAnimOsBottom = true;
animLayoutByTime(0, overHeight, time, overScrollBottomUpListener, new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
animLayoutByTime(overHeight, 0, 2 * time, overScrollBottomUpListener, new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isAnimOsBottom = false;
isOverScrollBottomLocked = false;
}
});
}
});
}
}
use of android.animation.AnimatorListenerAdapter in project NotificationPeekPort by lzanita09.
the class EverythingCard method hideOptions.
private void hideOptions() {
if (!mOptionsShowing) {
return;
}
mQuietHour.reset();
if (mPanelSwitcher.getDisplayedChild() == 1) {
mPanelSwitcher.showPrevious();
}
final int originalHeight = mPanelSwitcher.getHeight();
ValueAnimator animator = ValueAnimator.ofInt(mPanelSwitcher.getHeight(), 0);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
ViewGroup.LayoutParams params = mPanelSwitcher.getLayoutParams();
params.height = (Integer) animation.getAnimatedValue();
mPanelSwitcher.setLayoutParams(params);
}
});
animator.setDuration(ANIM_DURATION);
animator.setInterpolator(new DecelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mPanelSwitcher.setVisibility(GONE);
ViewGroup.LayoutParams params = mPanelSwitcher.getLayoutParams();
params.height = originalHeight;
mPanelSwitcher.setLayoutParams(params);
mFromBtn.setText(getContext().getString(R.string.from));
mToBtn.setText(getContext().getString(R.string.to));
}
});
animator.start();
mOptionsShowing = false;
}
Aggregations