mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Set smartspace to 30% visibility on workspace edit for home gardening
Here we set the smartspace to have 30% visibility to follow the guidelines set by https://docs.google.com/presentation/d/1FOmmCdmGmSMR77_901IOMbvbPVxPmjaAdxZjy-D9tw0/edit#slide=id.g159289e55db_0_229 Bug: 251259222 Test: Enter drag mode in workspace with SHOW_HOME_GARDENING flag on to see the changes Change-Id: Ia2ef4f1a49549fef9f8fbea7c007db8b81972f71
This commit is contained in:
@@ -29,11 +29,13 @@ import static com.android.launcher3.LauncherState.FLAG_HOTSEAT_INACCESSIBLE;
|
||||
import static com.android.launcher3.LauncherState.HINT_STATE;
|
||||
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.SPRING_LOADED;
|
||||
import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.anim.Interpolators.ZOOM_OUT;
|
||||
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
|
||||
import static com.android.launcher3.config.FeatureFlags.SHOW_HOME_GARDENING;
|
||||
import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS;
|
||||
import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_FADE;
|
||||
@@ -69,6 +71,8 @@ import com.android.systemui.plugins.ResourceProvider;
|
||||
*/
|
||||
public class WorkspaceStateTransitionAnimation {
|
||||
|
||||
private static final float QSB_DISABLED_ALPHA = 0.3f;
|
||||
|
||||
private static final FloatProperty<Workspace<?>> WORKSPACE_SCALE_PROPERTY =
|
||||
WORKSPACE_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WORKSPACE_STATE);
|
||||
|
||||
@@ -155,6 +159,18 @@ public class WorkspaceStateTransitionAnimation {
|
||||
float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0;
|
||||
propertySetter.setViewAlpha(hotseat, hotseatIconsAlpha, hotseatFadeInterpolator);
|
||||
|
||||
if (SHOW_HOME_GARDENING.get()) {
|
||||
propertySetter.setViewAlpha(
|
||||
mWorkspace.getQsb(),
|
||||
state == SPRING_LOADED ? QSB_DISABLED_ALPHA : 1,
|
||||
workspaceFadeInterpolator);
|
||||
propertySetter.addEndListener(success -> {
|
||||
if (success) {
|
||||
mWorkspace.getQsb().setClickable(state != SPRING_LOADED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update the accessibility flags for hotseat based on launcher state.
|
||||
hotseat.setImportantForAccessibility(
|
||||
state.hasFlag(FLAG_HOTSEAT_INACCESSIBLE)
|
||||
|
||||
Reference in New Issue
Block a user