summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sunny Goyal <sunnygoyal@google.com> 2021-05-04 12:56:28 -0700
committer Sunny Goyal <sunnygoyal@google.com> 2021-05-04 12:56:52 -0700
commit1a62ef4056b2e415698c8ef4082d40e651d0a97e (patch)
tree7ed4403935514f1be455b24810371c3ccd991503
parent16529a261391ac48968e86e54a69b7134ee71f7e (diff)
Removing generalization from OneHandledAnimationController
Bug: 152086714 Test: Manual Change-Id: I812c4c7163dc55a1e76b6423fd4fc9fce20f8a9a
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedAnimationController.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedAnimationController.java
index 180cceba068d..7e5fd927ea05 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedAnimationController.java
@@ -113,20 +113,18 @@ public class OneHandedAnimationController {
/**
* Animator for OneHanded transition animation which supports both alpha and bounds animation.
- *
- * @param <T> Type of property to animate, either offset (float)
*/
// TODO: Refactoring to use SpringAnimation and DynamicAnimation instead of using ValueAnimator
// to implement One-Handed transition animation. (b/185129031)
- public abstract static class OneHandedTransitionAnimator<T> extends ValueAnimator implements
+ public abstract static class OneHandedTransitionAnimator extends ValueAnimator implements
ValueAnimator.AnimatorUpdateListener,
ValueAnimator.AnimatorListener {
private final SurfaceControl mLeash;
private final WindowContainerToken mToken;
- private T mStartValue;
- private T mEndValue;
- private T mCurrentValue;
+ private float mStartValue;
+ private float mEndValue;
+ private float mCurrentValue;
private final List<OneHandedAnimationCallback> mOneHandedAnimationCallbacks =
new ArrayList<>();
@@ -137,7 +135,7 @@ public class OneHandedAnimationController {
private @TransitionDirection int mTransitionDirection;
private OneHandedTransitionAnimator(WindowContainerToken token, SurfaceControl leash,
- T startValue, T endValue) {
+ float startValue, float endValue) {
mLeash = leash;
mToken = token;
mStartValue = startValue;
@@ -204,7 +202,7 @@ public class OneHandedAnimationController {
mSurfaceTransactionHelper = helper;
}
- OneHandedTransitionAnimator<T> addOneHandedAnimationCallback(
+ OneHandedTransitionAnimator addOneHandedAnimationCallback(
OneHandedAnimationCallback callback) {
mOneHandedAnimationCallbacks.add(callback);
return this;
@@ -223,27 +221,27 @@ public class OneHandedAnimationController {
return mTransitionDirection;
}
- OneHandedTransitionAnimator<T> setTransitionDirection(int direction) {
+ OneHandedTransitionAnimator setTransitionDirection(int direction) {
mTransitionDirection = direction;
return this;
}
- T getStartValue() {
+ float getStartValue() {
return mStartValue;
}
- T getEndValue() {
+ float getEndValue() {
return mEndValue;
}
- void setCurrentValue(T value) {
+ void setCurrentValue(float value) {
mCurrentValue = value;
}
/**
* Updates the {@link #mEndValue}.
*/
- void updateEndValue(T endValue) {
+ void updateEndValue(float endValue) {
mEndValue = endValue;
}
@@ -252,10 +250,10 @@ public class OneHandedAnimationController {
}
@VisibleForTesting
- static OneHandedTransitionAnimator<Float> ofYOffset(WindowContainerToken token,
+ static OneHandedTransitionAnimator ofYOffset(WindowContainerToken token,
SurfaceControl leash, float startValue, float endValue, Rect displayBounds) {
- return new OneHandedTransitionAnimator<Float>(token, leash, startValue, endValue) {
+ return new OneHandedTransitionAnimator(token, leash, startValue, endValue) {
private final Rect mTmpRect = new Rect(displayBounds);