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

Commit 5a28ff76 authored by LuK1337's avatar LuK1337 Committed by Łukasz Patron
Browse files

SystemUI: Move network traffic monitor under same layout as clock

This effectively fixes wrongly network monitor layout on
devices with side notch / hole punch.

Change-Id: I217b886d8da75eab7636066f4822f5fd6dbc9aff
parent 46712ee2
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -109,22 +109,6 @@
            android:clipChildren="false"
            android:gravity="center_horizontal|center_vertical"/>

        <com.android.systemui.statusbar.LineageStatusBarItemHolder
            android:id="@+id/network_traffic_holder"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="start|center_vertical"
            >

            <org.lineageos.internal.statusbar.NetworkTraffic
                android:id="@+id/network_traffic"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:maxLines="2"
                android:gravity="center_vertical|start" />

        </com.android.systemui.statusbar.LineageStatusBarItemHolder>

        <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
            android:layout_width="0dp"
            android:layout_height="match_parent"
@@ -138,7 +122,7 @@
    </LinearLayout>

    <com.android.keyguard.AlphaOptimizedLinearLayout
        android:id="@+id/center_clock_layout"
        android:id="@+id/centered_area"
        android:gravity="center"
        android:orientation="horizontal"
        android:layout_width="match_parent"
@@ -153,6 +137,22 @@
            android:gravity="center"
            android:visibility="gone"
        />

        <com.android.systemui.statusbar.LineageStatusBarItemHolder
            android:id="@+id/network_traffic_holder"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            >

            <org.lineageos.internal.statusbar.NetworkTraffic
                android:id="@+id/network_traffic"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:maxLines="2"
                android:gravity="center" />

        </com.android.systemui.statusbar.LineageStatusBarItemHolder>
    </com.android.keyguard.AlphaOptimizedLinearLayout>

    <ViewStub
+5 −5
Original line number Diff line number Diff line
@@ -407,12 +407,12 @@ public class PhoneStatusBarView extends PanelBar implements Callbacks {

        setPadding(padding.first, getPaddingTop(), padding.second, getPaddingBottom());

        // Apply negative paddings to center clock layout so that we'll actually be on the center.
        // Apply negative paddings to centered area layout so that we'll actually be on the center.
        final int winRotation = getDisplay().getRotation();
        LayoutParams centerClockParams =
                (LayoutParams) findViewById(R.id.center_clock_layout).getLayoutParams();
        centerClockParams.leftMargin = winRotation == Surface.ROTATION_0 ? -padding.first : 0;
        centerClockParams.rightMargin = winRotation == Surface.ROTATION_0 ? -padding.second : 0;
        LayoutParams centeredAreaParams =
                (LayoutParams) findViewById(R.id.centered_area).getLayoutParams();
        centeredAreaParams.leftMargin = winRotation == Surface.ROTATION_0 ? -padding.first : 0;
        centeredAreaParams.rightMargin = winRotation == Surface.ROTATION_0 ? -padding.second : 0;
    }

    public void setHeadsUpVisible(boolean headsUpVisible) {