summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/touch
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-07-23 11:26:38 -0700
committerSunny Goyal <sunnygoyal@google.com>2019-07-24 10:12:37 -0700
commit4e6c45bcd3717af05a892a92565d55aa20728644 (patch)
treea4cd5eff6806d6962c5ca7dcfbeacfb24a31c49e /src/com/android/launcher3/touch
parentb6841ac630fd4ca894e2638586511e3085c40baa (diff)
downloadandroid_packages_apps_Trebuchet-4e6c45bcd3717af05a892a92565d55aa20728644.tar.gz
android_packages_apps_Trebuchet-4e6c45bcd3717af05a892a92565d55aa20728644.tar.bz2
android_packages_apps_Trebuchet-4e6c45bcd3717af05a892a92565d55aa20728644.zip
Using the first frame delay based on the display refresh rate instead of
hardcoding it to 16ms > Creating a utility class for caching display property changes Bug: 128940249 Change-Id: I6f9a214548de65bd1c8530508d665ee88312da4a
Diffstat (limited to 'src/com/android/launcher3/touch')
-rw-r--r--src/com/android/launcher3/touch/AbstractStateChangeTouchController.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index ae69f3b32..49f515ad4 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -22,9 +22,9 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_SCALE_COMPONENT;
import static com.android.launcher3.LauncherStateManager.NON_ATOMIC_COMPONENT;
-import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS;
+import static com.android.launcher3.util.DefaultDisplay.getSingleFrameMs;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -55,8 +55,6 @@ import com.android.launcher3.util.TouchController;
public abstract class AbstractStateChangeTouchController
implements TouchController, SwipeDetector.Listener {
- private static final String TAG = "ASCTouchController";
-
// Progress after which the transition is assumed to be a success in case user does not fling
public static final float SUCCESS_TRANSITION_PROGRESS = 0.5f;
@@ -396,8 +394,8 @@ public abstract class AbstractStateChangeTouchController
duration = 0;
startProgress = 1;
} else {
- startProgress = Utilities.boundToRange(
- progress + velocity * SINGLE_FRAME_MS * mProgressMultiplier, 0f, 1f);
+ startProgress = Utilities.boundToRange(progress
+ + velocity * getSingleFrameMs(mLauncher) * mProgressMultiplier, 0f, 1f);
duration = SwipeDetector.calculateDuration(velocity,
endProgress - Math.max(progress, 0)) * durationMultiplier;
}
@@ -414,8 +412,8 @@ public abstract class AbstractStateChangeTouchController
duration = 0;
startProgress = 0;
} else {
- startProgress = Utilities.boundToRange(
- progress + velocity * SINGLE_FRAME_MS * mProgressMultiplier, 0f, 1f);
+ startProgress = Utilities.boundToRange(progress
+ + velocity * getSingleFrameMs(mLauncher) * mProgressMultiplier, 0f, 1f);
duration = SwipeDetector.calculateDuration(velocity,
Math.min(progress, 1) - endProgress) * durationMultiplier;
}