use of com.nineoldandroids.animation.AnimatorListenerAdapter in project PhotoNoter by yydcdut.
the class PhotoDetailActivity method hideWidget.
@Override
public void hideWidget(final IPhotoDetailPresenter.OnAnimationAdapter onAnimationAdapter) {
AnimatorSet animation = new AnimatorSet();
animation.setDuration(1000);
animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0, -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0)), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop(), mBottomLayout.getTop() + getActionBarSize()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", 0f, -getActionBarSize()));
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
if (onAnimationAdapter != null) {
onAnimationAdapter.onAnimationStarted(IPhotoDetailPresenter.STATE_HIDE);
}
}
@Override
public void onAnimationEnd(Animator animation) {
if (onAnimationAdapter != null) {
onAnimationAdapter.onAnimationEnded(IPhotoDetailPresenter.STATE_HIDE);
}
}
});
animation.start();
}
use of com.nineoldandroids.animation.AnimatorListenerAdapter in project PhotoNoter by yydcdut.
the class DetailActivity method upAnimation.
@Override
public void upAnimation() {
View adapterPositionView = mDetailPagerAdapter.getItemView(mViewPager.getCurrentItem());
View blurView;
if (adapterPositionView != null) {
blurView = adapterPositionView.findViewById(R.id.img_blur);
} else {
blurView = mOverlayView;
}
final View finalBlurView = blurView;
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ObjectAnimator.ofFloat(mCardView, "translationY", mTranslateHeight, 0), ObjectAnimator.ofFloat(mViewPager, "scaleX", 1f, 1.1f), ObjectAnimator.ofFloat(mViewPager, "scaleY", 1f, 1.1f), ObjectAnimator.ofFloat(finalBlurView, "alpha", 0f, 1f));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
finalBlurView.setVisibility(View.VISIBLE);
mOverlayView.setVisibility(View.VISIBLE);
mIsIgnoreClick = true;
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mIsIgnoreClick = false;
}
});
animatorSet.setDuration(400);
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.start();
mAnimationHandler.postDelayed(mUpDelayRunnable, 500);
}
use of com.nineoldandroids.animation.AnimatorListenerAdapter in project PhotoNoter by yydcdut.
the class DetailActivity method downAnimation.
@Override
public void downAnimation() {
View adapterPositionView = mDetailPagerAdapter.getItemView(mViewPager.getCurrentItem());
View blurView;
if (adapterPositionView != null) {
blurView = adapterPositionView.findViewById(R.id.img_blur);
} else {
blurView = mOverlayView;
}
final View finalBlurView = blurView;
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(ObjectAnimator.ofFloat(mCardView, "translationY", 0, mTranslateHeight), ObjectAnimator.ofFloat(mViewPager, "scaleX", 1.1f, 1.0f), ObjectAnimator.ofFloat(mViewPager, "scaleY", 1.1f, 1.0f), ObjectAnimator.ofFloat(finalBlurView, "alpha", 1f, 0f));
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
finalBlurView.setVisibility(View.GONE);
mOverlayView.setVisibility(View.GONE);
mIsIgnoreClick = true;
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
mIsIgnoreClick = true;
}
});
animatorSet.setDuration(400);
animatorSet.setInterpolator(new DecelerateInterpolator());
animatorSet.start();
mAnimationHandler.postDelayed(mDownDelayRunnable, 350);
}
use of com.nineoldandroids.animation.AnimatorListenerAdapter in project PhotoNoter by yydcdut.
the class PhotoDetailActivity method hideWidget.
private void hideWidget() {
AnimatorSet animation = new AnimatorSet();
animation.setDuration(1000);
animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0, -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0)), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop(), mBottomLayout.getTop() + getActionBarSize()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", 0f, -getActionBarSize()));
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
isAnimationDoing = true;
if (AppCompat.AFTER_LOLLIPOP) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimationDoing = false;
isWidgetShowed = false;
}
});
animation.start();
}
use of com.nineoldandroids.animation.AnimatorListenerAdapter in project PhotoNoter by yydcdut.
the class PhotoDetailActivity method showWidget.
private void showWidget() {
AnimatorSet animation = new AnimatorSet();
animation.setDuration(1000);
animation.playTogether(ObjectAnimator.ofFloat(mAppBarLayout, "Y", -getActionBarSize() - (AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), AppCompat.AFTER_LOLLIPOP ? getStatusBarSize() : 0), ObjectAnimator.ofFloat(mBottomLayout, "Y", mBottomLayout.getTop() + getActionBarSize(), mBottomLayout.getTop()), ObjectAnimator.ofFloat(mStatusCoverView, "Y", -getActionBarSize(), 0f));
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
isAnimationDoing = true;
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimationDoing = false;
isWidgetShowed = true;
if (AppCompat.AFTER_LOLLIPOP) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
}
});
animation.start();
}
Aggregations