summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/answer/impl/affordance
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/answer/impl/affordance')
-rw-r--r--java/com/android/incallui/answer/impl/affordance/SwipeButtonHelper.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/java/com/android/incallui/answer/impl/affordance/SwipeButtonHelper.java b/java/com/android/incallui/answer/impl/affordance/SwipeButtonHelper.java
index ff20d3a05..1c66e63b8 100644
--- a/java/com/android/incallui/answer/impl/affordance/SwipeButtonHelper.java
+++ b/java/com/android/incallui/answer/impl/affordance/SwipeButtonHelper.java
@@ -68,13 +68,19 @@ public class SwipeButtonHelper {
targetedView = null;
}
};
- private Runnable animationEndRunnable =
- new Runnable() {
- @Override
- public void run() {
- callback.onAnimationToSideEnded();
- }
- };
+
+ private class AnimationEndRunnable implements Runnable {
+ private final boolean rightPage;
+
+ public AnimationEndRunnable(boolean rightPage) {
+ this.rightPage = rightPage;
+ }
+
+ @Override
+ public void run() {
+ callback.onAnimationToSideEnded(rightPage);
+ }
+ };
public SwipeButtonHelper(Callback callback, Context context) {
this.context = context;
@@ -386,7 +392,7 @@ public class SwipeButtonHelper {
});
animator.addListener(flingEndListener);
if (!snapBack) {
- startFinishingCircleAnimation(vel * 0.375f, animationEndRunnable, right);
+ startFinishingCircleAnimation(vel * 0.375f, new AnimationEndRunnable(right), right);
callback.onAnimationToSideStarted(right, translation, vel);
} else {
reset(true);
@@ -599,7 +605,7 @@ public class SwipeButtonHelper {
updateIcon(otherView, 0.0f, 0.0f, false, false, true, false);
targetView.instantFinishAnimation();
flingEndListener.onAnimationEnd(null);
- animationEndRunnable.run();
+ new AnimationEndRunnable(!left).run();
}
}
@@ -614,7 +620,7 @@ public class SwipeButtonHelper {
void onAnimationToSideStarted(boolean rightPage, float translation, float vel);
/** Notifies the callback the animation to a side page has ended. */
- void onAnimationToSideEnded();
+ void onAnimationToSideEnded(boolean rightPage);
float getMaxTranslationDistance();