mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
[Search][Motion] Modify interpolator for AllApps background scrim
Also rename ANIM_WORKSPACE_SCRIM_FADE to ANIM_SCRIM_FADE since the scrim is shared between states now. Bug: 183001675 Test: Manual in 3 button and 0 button modes Change-Id: Ice83b54480bdf74155e8593c421b68d7186cf78a
This commit is contained in:
committed by
Tony Wickham
parent
154b1c928b
commit
3ab273da0c
@@ -24,6 +24,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
|
||||
|
||||
import android.view.MotionEvent;
|
||||
|
||||
@@ -56,7 +57,17 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
/**
|
||||
* Minimum clamping progress for fading in all apps content
|
||||
*/
|
||||
protected static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.4f;
|
||||
protected static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.5f;
|
||||
|
||||
/**
|
||||
* Minimum clamping progress for fading in all apps scrim
|
||||
*/
|
||||
protected static final float ALL_APPS_SCRIM_VISIBLE_THRESHOLD = .1f;
|
||||
|
||||
/**
|
||||
* Maximum clamping progress for opaque all apps scrim
|
||||
*/
|
||||
protected static final float ALL_APPS_SCRIM_OPAQUE_THRESHOLD = .5f;
|
||||
|
||||
private final PortraitOverviewStateTouchHelper mOverviewPortraitStateTouchHelper;
|
||||
|
||||
@@ -116,14 +127,22 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
private StateAnimationConfig getNormalToAllAppsAnimation() {
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
0, ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD));
|
||||
ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD,
|
||||
ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD));
|
||||
builder.setInterpolator(ANIM_SCRIM_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
ALL_APPS_SCRIM_VISIBLE_THRESHOLD,
|
||||
ALL_APPS_SCRIM_OPAQUE_THRESHOLD));
|
||||
return builder;
|
||||
}
|
||||
|
||||
private StateAnimationConfig getAllAppsToNormalAnimation() {
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL,
|
||||
1 - ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD, 1));
|
||||
1 - ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD,
|
||||
1 - ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD));
|
||||
builder.setInterpolator(ANIM_SCRIM_FADE, Interpolators.clampToProgress(DEACCEL,
|
||||
1 - ALL_APPS_SCRIM_OPAQUE_THRESHOLD,
|
||||
1 - ALL_APPS_SCRIM_VISIBLE_THRESHOLD));
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user