[AllApps] NORMAL <-> ALL_APPS motion clean fixes for AOSP

- Avoids drawing on scrim when headerProtection is not enabled.
- Defines a default staggered animation for all apps scrim and content per S design guidelines

[preview attached to bug]

Bug: 191259805
Test: visual
Change-Id: I0d625c9f0caba158ff58f12a39b4f18aedead84b
This commit is contained in:
Samuel Fufa
2021-09-10 18:27:53 -07:00
parent 9874b5d68b
commit 776443b337
3 changed files with 35 additions and 8 deletions

View File

@@ -37,7 +37,6 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.config.FeatureFlags;
@@ -59,7 +58,6 @@ public class AllAppsTransitionController
implements StateHandler<LauncherState>, OnDeviceProfileChangeListener {
// This constant should match the second derivative of the animator interpolator.
public static final float INTERP_COEFF = 1.7f;
private static final float CONTENT_VISIBLE_MAX_THRESHOLD = 0.5f;
public static final FloatProperty<AllAppsTransitionController> ALL_APPS_PROGRESS =
new FloatProperty<AllAppsTransitionController>("allAppsProgress") {
@@ -181,8 +179,7 @@ public class AllAppsTransitionController
int visibleElements = state.getVisibleElements(mLauncher);
boolean hasAllAppsContent = (visibleElements & ALL_APPS_CONTENT) != 0;
Interpolator allAppsFade = config.getInterpolator(ANIM_ALL_APPS_FADE,
Interpolators.clampToProgress(LINEAR, 0, CONTENT_VISIBLE_MAX_THRESHOLD));
Interpolator allAppsFade = config.getInterpolator(ANIM_ALL_APPS_FADE, LINEAR);
setter.setViewAlpha(mAppsView, hasAllAppsContent ? 1 : 0, allAppsFade);
boolean shouldProtectHeader =