Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbd9ebd0 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Make workspace and hotseat scale down in widgets picker" into tm-qpr-dev

parents c9e5c2bd 0c4e11b4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@
    <dimen name="quickstep_fling_threshold_speed">0.5dp</dimen>

    <!-- Launcher app transition -->
    <item name="content_scale" format="float" type="dimen">0.97</item>
    <dimen name="closing_window_trans_y">115dp</dimen>

    <dimen name="quick_switch_scaling_scroll_threshold">100dp</dimen>
+2 −4
Original line number Diff line number Diff line
@@ -200,7 +200,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener

    final Handler mHandler;

    private final float mContentScale;
    private final float mClosingWindowTransY;
    private final float mMaxShadowRadius;

@@ -245,7 +244,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
        mBackAnimationController = new LauncherBackAnimationController(mLauncher, this);

        Resources res = mLauncher.getResources();
        mContentScale = res.getFloat(R.dimen.content_scale);
        mClosingWindowTransY = res.getDimensionPixelSize(R.dimen.closing_window_trans_y);
        mMaxShadowRadius = res.getDimensionPixelSize(R.dimen.max_shadow_radius);

@@ -483,8 +481,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                : new float[]{0, 1};

        float[] scales = isAppOpening
                ? new float[]{1, mContentScale}
                : new float[]{mContentScale, 1};
                ? new float[]{1, mDeviceProfile.workspaceContentScale}
                : new float[]{mDeviceProfile.workspaceContentScale, 1};

        // Pause expensive view updates as they can lead to layer thrashing and skipped frames.
        mLauncher.pauseExpensiveViewUpdates();
+3 −4
Original line number Diff line number Diff line
@@ -31,8 +31,6 @@ import com.android.launcher3.util.Themes;
 */
public class AllAppsState extends LauncherState {

    private static final float WORKSPACE_SCALE_FACTOR = 0.97f;

    private static final int STATE_FLAGS =
            FLAG_WORKSPACE_INACCESSIBLE | FLAG_CLOSE_POPUPS | FLAG_HOTSEAT_INACCESSIBLE;

@@ -60,7 +58,8 @@ public class AllAppsState extends LauncherState {

    @Override
    public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
        return new ScaleAndTranslation(WORKSPACE_SCALE_FACTOR, NO_OFFSET, NO_OFFSET);
        return new ScaleAndTranslation(launcher.getDeviceProfile().workspaceContentScale, NO_OFFSET,
                NO_OFFSET);
    }

    @Override
@@ -71,7 +70,7 @@ public class AllAppsState extends LauncherState {
            ScaleAndTranslation overviewScaleAndTranslation = LauncherState.OVERVIEW
                    .getWorkspaceScaleAndTranslation(launcher);
            return new ScaleAndTranslation(
                    WORKSPACE_SCALE_FACTOR,
                    launcher.getDeviceProfile().workspaceContentScale,
                    overviewScaleAndTranslation.translationX,
                    overviewScaleAndTranslation.translationY);
        }
+3 −0
Original line number Diff line number Diff line
@@ -413,4 +413,7 @@
    <dimen name="bottom_sheet_handle_height">4dp</dimen>
    <dimen name="bottom_sheet_handle_margin">16dp</dimen>
    <dimen name="bottom_sheet_handle_corner_radius">2dp</dimen>

    <!-- State transition -->
    <item name="workspace_content_scale" format="float" type="dimen">0.97</item>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ public class DeviceProfile {
    public Rect cellLayoutPaddingPx = new Rect();

    public final int edgeMarginPx;
    public final float workspaceContentScale;
    public float workspaceSpringLoadShrunkTop;
    public float workspaceSpringLoadShrunkBottom;
    public final int workspaceSpringLoadedBottomSpace;
@@ -298,6 +299,7 @@ public class DeviceProfile {
        }

        edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin);
        workspaceContentScale = res.getFloat(R.dimen.workspace_content_scale);

        desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res);
        desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx;
Loading