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

Commit 058c8aee authored by Evan Laird's avatar Evan Laird
Browse files

Initial support for camera cutout in CollapsedStatusBar

- Display a space view exactly covering where the display cutout is

- Custom layout for system_icons because this view needs to now layout
right-to-left, and hide icons that don't fit. Similar to notification
icon container but in the other direction. Still needs dots and to limit
the # of icons

- When in landscape/seascape, the cutout space disappears and instead
the status bar insets itself by the same amount that the window is
letterboxed

- Moved battery percent back to the right of the battery because the
time is no longer on that side

Test: adb shell cmd overlay enable
com.android.internal.display.cutout.emulation && adb shell stop && adb
shell start # to start emulation
Bug: 63772836

Change-Id: I8071bfb4983a9d9306df1487cdac956494e80c28
parent 588a06f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,6 +25,6 @@
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
        android:textColor="?android:attr/textColorPrimary"
        android:gravity="center_vertical|start"
        android:paddingEnd="@dimen/battery_level_padding_start"
        android:paddingStart="@dimen/battery_level_padding_start"
        android:importantForAccessibility="no"
        />
+34 −17
Original line number Diff line number Diff line
@@ -54,11 +54,16 @@
            android:layout_height="match_parent"
            android:layout="@layout/operator_name" />

        <LinearLayout
            android:layout_height="match_parent"
            android:layout_width="0dp"
            android:layout_weight="1"
        >
            <com.android.systemui.statusbar.policy.Clock
                android:id="@+id/clock"
            android:textAppearance="@style/TextAppearance.StatusBar.Clock"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:textAppearance="@style/TextAppearance.StatusBar.Clock"
                android:singleLine="true"
                android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
                android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
@@ -69,15 +74,27 @@
                 PhoneStatusBar (DISABLE_NOTIFICATION_ICONS). -->
            <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
                android:id="@+id/notification_icon_area"
            android:layout_width="0dip"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal" />

        </LinearLayout>

        <!-- Space should cover the notch (if it exists) and let other views lay out around it -->
        <android.widget.Space
            android:id="@+id/cutout_space_view"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:gravity="center_horizontal|center_vertical"
        />

        <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
            android:layout_width="wrap_content"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal"
            android:gravity="center_vertical|end"
            >

            <include layout="@layout/system_icons" />
+4 −3
Original line number Diff line number Diff line
@@ -16,12 +16,13 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/system_icons"
    android:layout_width="wrap_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_vertical">

    <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/statusIcons"
        android:layout_width="wrap_content"
    <com.android.systemui.statusbar.phone.StatusIconContainer android:id="@+id/statusIcons"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal"/>
+3 −0
Original line number Diff line number Diff line
@@ -93,5 +93,8 @@
    <item type="id" name="action_snooze_long"/>
    <item type="id" name="action_snooze_longer"/>
    <item type="id" name="action_snooze_assistant_suggestion_1"/>

    <!-- For StatusBarIconContainer to tag its icon views -->
    <item type="id" name="status_bar_view_state_tag" />
</resources>
+0 −1
Original line number Diff line number Diff line
@@ -224,7 +224,6 @@ public class BatteryMeterView extends LinearLayout implements
                if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor);
                updatePercentText();
                addView(mBatteryPercentView,
                        0,
                        new ViewGroup.LayoutParams(
                                LayoutParams.WRAP_CONTENT,
                                LayoutParams.MATCH_PARENT));
Loading