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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user