Merge "Add ENABLE_SCRIM_FOR_APP_LAUNCH feature flag." into sc-dev am: 28e39335bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14987185 Change-Id: I435686c2438f00d81c93ab13b8f77f1a77ebf7e7
This commit is contained in:
commit
d2e9de7fa8
2 files changed
+24
-14
No files matched your search
@@ -34,6 +34,7 @@ import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
|
|||||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
|
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
|
||||||
import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE;
|
import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE;
|
||||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||||
|
import static com.android.launcher3.config.FeatureFlags.ENABLE_SCRIM_FOR_APP_LAUNCH;
|
||||||
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
|
import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION;
|
||||||
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
|
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
|
||||||
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_TRANSITIONS;
|
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_TRANSITIONS;
|
||||||
@@ -508,20 +509,23 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
|||||||
launcherAnimator.play(scaleAnim);
|
launcherAnimator.play(scaleAnim);
|
||||||
});
|
});
|
||||||
|
|
||||||
int scrimColor = Themes.getAttrColor(mLauncher, R.attr.overviewScrimColor);
|
final boolean scrimEnabled = ENABLE_SCRIM_FOR_APP_LAUNCH.get();
|
||||||
int scrimColorTrans = ColorUtils.setAlphaComponent(scrimColor, 0);
|
if (scrimEnabled) {
|
||||||
int[] colors = isAppOpening
|
int scrimColor = Themes.getAttrColor(mLauncher, R.attr.overviewScrimColor);
|
||||||
? new int[] {scrimColorTrans, scrimColor}
|
int scrimColorTrans = ColorUtils.setAlphaComponent(scrimColor, 0);
|
||||||
: new int[] {scrimColor, scrimColorTrans};
|
int[] colors = isAppOpening
|
||||||
ScrimView scrimView = mLauncher.getScrimView();
|
? new int[]{scrimColorTrans, scrimColor}
|
||||||
if (scrimView.getBackground() instanceof ColorDrawable) {
|
: new int[]{scrimColor, scrimColorTrans};
|
||||||
scrimView.setBackgroundColor(colors[0]);
|
ScrimView scrimView = mLauncher.getScrimView();
|
||||||
|
if (scrimView.getBackground() instanceof ColorDrawable) {
|
||||||
|
scrimView.setBackgroundColor(colors[0]);
|
||||||
|
|
||||||
ObjectAnimator scrim = ObjectAnimator.ofArgb(scrimView, VIEW_BACKGROUND_COLOR,
|
ObjectAnimator scrim = ObjectAnimator.ofArgb(scrimView, VIEW_BACKGROUND_COLOR,
|
||||||
colors);
|
colors);
|
||||||
scrim.setDuration(CONTENT_SCRIM_DURATION);
|
scrim.setDuration(CONTENT_SCRIM_DURATION);
|
||||||
scrim.setInterpolator(DEACCEL_1_5);
|
scrim.setInterpolator(DEACCEL_1_5);
|
||||||
launcherAnimator.play(scrim);
|
launcherAnimator.play(scrim);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pause page indicator animations as they lead to layer trashing.
|
// Pause page indicator animations as they lead to layer trashing.
|
||||||
@@ -532,7 +536,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
|||||||
SCALE_PROPERTY.set(view, 1f);
|
SCALE_PROPERTY.set(view, 1f);
|
||||||
view.setLayerType(View.LAYER_TYPE_NONE, null);
|
view.setLayerType(View.LAYER_TYPE_NONE, null);
|
||||||
});
|
});
|
||||||
scrimView.setBackgroundColor(Color.TRANSPARENT);
|
if (scrimEnabled) {
|
||||||
|
mLauncher.getScrimView().setBackgroundColor(Color.TRANSPARENT);
|
||||||
|
}
|
||||||
mLauncher.getWorkspace().getPageIndicator().skipAnimationsToEnd();
|
mLauncher.getWorkspace().getPageIndicator().skipAnimationsToEnd();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,6 +220,10 @@ public final class FeatureFlags {
|
|||||||
"ENABLE_TWO_PANEL_HOME", false,
|
"ENABLE_TWO_PANEL_HOME", false,
|
||||||
"Uses two panel on home screen. Only applicable on large screen devices.");
|
"Uses two panel on home screen. Only applicable on large screen devices.");
|
||||||
|
|
||||||
|
public static final BooleanFlag ENABLE_SCRIM_FOR_APP_LAUNCH = getDebugFlag(
|
||||||
|
"ENABLE_SCRIM_FOR_APP_LAUNCH", false,
|
||||||
|
"Enables scrim during app launch animation.");
|
||||||
|
|
||||||
public static final BooleanFlag ENABLE_SPLIT_SELECT = getDebugFlag(
|
public static final BooleanFlag ENABLE_SPLIT_SELECT = getDebugFlag(
|
||||||
"ENABLE_SPLIT_SELECT", false, "Uses new split screen selection overview UI");
|
"ENABLE_SPLIT_SELECT", false, "Uses new split screen selection overview UI");
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user