summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Utilities.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-06-08 13:01:04 -0700
committerSunny Goyal <sunnygoyal@google.com>2018-06-11 09:51:42 -0700
commit0f3af75eb044ec7ec7f41c80c20ccab43d749567 (patch)
tree9438d270565e4d734da4034fb19c38cace34cabd /src/com/android/launcher3/Utilities.java
parent808e7cae6677695be4a139374f34c3ed87ba6385 (diff)
downloadandroid_packages_apps_Trebuchet-0f3af75eb044ec7ec7f41c80c20ccab43d749567.tar.gz
android_packages_apps_Trebuchet-0f3af75eb044ec7ec7f41c80c20ccab43d749567.tar.bz2
android_packages_apps_Trebuchet-0f3af75eb044ec7ec7f41c80c20ccab43d749567.zip
Making the self always follow the vertical progress without any min height limit.
After a certain height, the self fades out, but keeps following the vertical progress. Eventually the fade-out can be decoupled from vertical progress and tied to the state Bug: 109829614 Change-Id: I9808ed3fa1730b938196bc6d3518a6d096a13f4c
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r--src/com/android/launcher3/Utilities.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 5355c5e55..7fe8d35cb 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -48,6 +48,7 @@ import android.util.Log;
import android.util.Pair;
import android.util.TypedValue;
import android.view.View;
+import android.view.animation.Interpolator;
import com.android.launcher3.config.FeatureFlags;
@@ -281,13 +282,14 @@ public final class Utilities {
* @param toMax The upper bound of the range that t is being mapped to.
* @return The mapped value of t.
*/
- public static float mapToRange(float t, float fromMin, float fromMax, float toMin, float toMax) {
+ public static float mapToRange(float t, float fromMin, float fromMax, float toMin, float toMax,
+ Interpolator interpolator) {
if (fromMin == fromMax || toMin == toMax) {
Log.e(TAG, "mapToRange: range has 0 length");
return toMin;
}
float progress = Math.abs(t - fromMin) / Math.abs(fromMax - fromMin);
- return mapRange(progress, toMin, toMax);
+ return mapRange(interpolator.getInterpolation(progress), toMin, toMax);
}
public static float mapRange(float value, float min, float max) {