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

Commit 22af6508 authored by Adrian Roos's avatar Adrian Roos
Browse files

WM: Split portrait and landscape status bar size

For devices with a display cutout, it is no longer feasible to have the
same status bar size in portrait and landscape.

Special care has to be taken because a lot of third-party apps (and bundled apps)
rely on @dimen/status_bar_height, so we make sure that in -land it is set
to the landscape value.

Note that resource overlays for @dimen/status_bar_height MUST be renamed to
status_bar_height_portrait, otherwise they will only override the portrait
orientation, while landscape will continue to be 24dp!

Bug: 73717865
Test: Enable display cutout, ensure status bar is smaller in landscape.
Change-Id: If2718e53c3a10e3cab092d4b6a0a2a3bdd0cea81
parent 78cab5a5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@
    <dimen name="password_keyboard_spacebar_vertical_correction">2dip</dimen>
    <dimen name="preference_widget_width">72dp</dimen>

    <!-- Height of the status bar -->
    <dimen name="status_bar_height">@dimen/status_bar_height_landscape</dimen>

    <!-- Default height of an action bar. -->
    <dimen name="action_bar_default_height">40dip</dimen>
    <!-- Vertical padding around action bar icons. -->
+5 −1
Original line number Diff line number Diff line
@@ -32,7 +32,11 @@

    <dimen name="toast_y_offset">24dp</dimen>
    <!-- Height of the status bar -->
    <dimen name="status_bar_height">24dp</dimen>
    <dimen name="status_bar_height">@dimen/status_bar_height_portrait</dimen>
    <!-- Height of the status bar in portrait -->
    <dimen name="status_bar_height_portrait">24dp</dimen>
    <!-- Height of the status bar in landscape -->
    <dimen name="status_bar_height_landscape">@dimen/status_bar_height_portrait</dimen>
    <!-- Height of area above QQS where battery/time go -->
    <dimen name="quick_qs_offset_height">48dp</dimen>
    <!-- Total height of QQS (quick_qs_offset_height + 128) -->
+3 −0
Original line number Diff line number Diff line
@@ -3234,6 +3234,9 @@

  <java-symbol type="string" name="battery_saver_warning_title" />

  <java-symbol type="dimen" name="status_bar_height_portrait" />
  <java-symbol type="dimen" name="status_bar_height_landscape" />

  <java-symbol type="string" name="global_action_logout" />
  <java-symbol type="string" name="config_mainBuiltInDisplayCutout" />
  <java-symbol type="drawable" name="messaging_user" />
+11 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.support.v4.util.ArraySet;
import android.util.Log;
@@ -32,6 +33,7 @@ import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.VisualStabilityManager;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;

@@ -45,12 +47,12 @@ import java.util.Stack;
 */
public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
       ViewTreeObserver.OnComputeInternalInsetsListener, VisualStabilityManager.Callback,
       OnHeadsUpChangedListener {
       OnHeadsUpChangedListener, ConfigurationController.ConfigurationListener {
    private static final String TAG = "HeadsUpManagerPhone";
    private static final boolean DEBUG = false;

    private final View mStatusBarWindowView;
    private final int mStatusBarHeight;
    private int mStatusBarHeight;
    private final NotificationGroupManager mGroupManager;
    private final StatusBar mBar;
    private final VisualStabilityManager mVisualStabilityManager;
@@ -291,6 +293,13 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
        }
    }

    @Override
    public void onConfigChanged(Configuration newConfig) {
        Resources resources = mContext.getResources();
        mStatusBarHeight = resources.getDimensionPixelSize(
                com.android.internal.R.dimen.status_bar_height);
    }

    ///////////////////////////////////////////////////////////////////////////////////////////////
    //  VisualStabilityManager.Callback overrides:

+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ public class PhoneStatusBarView extends PanelBar {
        mScrimController.setPanelExpansion(scrimFraction);
    }

    public void onDensityOrFontScaleChanged() {
    public void updateResources() {
        ViewGroup.LayoutParams layoutParams = getLayoutParams();
        layoutParams.height = getResources().getDimensionPixelSize(
                R.dimen.status_bar_height);
Loading