Use default AnimatorListener
This commit is contained in:
1 parent
56fc7507e3
commit
458a275dcd
7 files changed
+12
-49
No files matched your search
@@ -20,24 +20,16 @@ import android.animation.Animator;
|
||||
|
||||
public abstract class SimpleAnimatorListener implements Animator.AnimatorListener {
|
||||
|
||||
private boolean mCanceled;
|
||||
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
mCanceled = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
onAnimationEnd(animation, mCanceled);
|
||||
}
|
||||
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
mCanceled = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -109,19 +109,10 @@ public class ViewTransition {
|
||||
oa1.setDuration(ANIMATE_TIME);
|
||||
oa1.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
super.onAnimationCancel(animation);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
ViewUtils.setVisibility(hiddenView, View.GONE);
|
||||
mAnimator1 = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
if (!canceled) {
|
||||
ViewUtils.setVisibility(hiddenView, View.GONE);
|
||||
mAnimator1 = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
oa1.start();
|
||||
mAnimator1 = oa1;
|
||||
@@ -131,18 +122,9 @@ public class ViewTransition {
|
||||
oa2.setDuration(ANIMATE_TIME);
|
||||
oa2.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
super.onAnimationCancel(animation);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mAnimator2 = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
if (!canceled) {
|
||||
mAnimator2 = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
oa2.start();
|
||||
mAnimator2 = oa2;
|
||||
|
||||
@@ -66,6 +66,7 @@ import java.util.List;
|
||||
|
||||
import static com.hippo.ehviewer.R.id.no_tags;
|
||||
|
||||
// TODO Use RecyclerView instead of ScrollView. It will improve swipe horizontally and animation
|
||||
public class GalleryDetailScene extends Scene implements View.OnClickListener,
|
||||
AccurateClick.OnAccurateClickListener {
|
||||
|
||||
@@ -420,6 +421,8 @@ public class GalleryDetailScene extends Scene implements View.OnClickListener,
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean AAA = false;
|
||||
|
||||
private class EhDetailListener extends EhClient.OnGetGalleryDetailListener {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -614,8 +614,7 @@ public final class GalleryListScene extends Scene implements SearchBar.Helper,
|
||||
va.setDuration(ANIMATE_TIME);
|
||||
va.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mSearchBarMoveAnimator = null;
|
||||
}
|
||||
});
|
||||
@@ -676,8 +675,7 @@ public final class GalleryListScene extends Scene implements SearchBar.Helper,
|
||||
va.setDuration(ANIMATE_TIME);
|
||||
va.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mSearchBarMoveAnimator = null;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -127,8 +127,7 @@ public class RippleCurtain extends Curtain {
|
||||
mAnimatorSet.playTogether(animatorCollection);
|
||||
mAnimatorSet.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
dispatchCloseFinished(enter, exit);
|
||||
mAnimatorSet = null;
|
||||
|
||||
|
||||
@@ -89,8 +89,7 @@ public class SimpleCurtain extends Curtain {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
dispatchOpenFinished(enter, exit);
|
||||
hideSceneOnOpen(exit);
|
||||
mAnimator = null;
|
||||
@@ -137,8 +136,7 @@ public class SimpleCurtain extends Curtain {
|
||||
animator.setInterpolator(AnimationUtils.SLOW_FAST_INTERPOLATOR);
|
||||
animator.addListener(new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
dispatchCloseFinished(enter, exit);
|
||||
mAnimator = null;
|
||||
}
|
||||
|
||||
@@ -113,18 +113,9 @@ public class CheckTextView extends TextView implements OnClickListener, Hotspota
|
||||
|
||||
private Animator.AnimatorListener mAnimatorListener = new SimpleAnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
super.onAnimationCancel(animation);
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mAnimator = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation, boolean canceled) {
|
||||
super.onAnimationEnd(animation, canceled);
|
||||
if (!canceled) {
|
||||
mAnimator = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void prepareAnimations() {
|
||||
|
||||
Reference in new issue
Block a user