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

Commit 0d74eeb9 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Reparent status bar icons into header when expanded.

This change moves the status bar icons into the quick settings header
when the status bar is expanded. Also, the universal header is now
showing on the Keyguard.

Change-Id: Ib91f7e0b8de9f852676a11b500c4419183db1b90
parent 3084a299
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -77,26 +77,24 @@
        <LinearLayout android:id="@+id/system_icon_area"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal">

            android:orientation="horizontal"
            >
            <LinearLayout android:id="@+id/system_icons"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center_vertical"
                >
                <LinearLayout android:id="@+id/statusIcons"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"/>

            <LinearLayout
                android:id="@+id/signal_battery_cluster"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:paddingStart="2dp"
                android:orientation="horizontal"
                android:gravity="center"
                >
                <include layout="@layout/signal_cluster_view"
                    android:id="@+id/signal_cluster"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="2dp"
                    />
                <!-- battery must be padded below to match assets -->
                <com.android.systemui.BatteryMeterView
@@ -107,7 +105,6 @@
                    android:layout_marginStart="4dip"
                    />
            </LinearLayout>
    
            <com.android.systemui.statusbar.policy.Clock
                android:id="@+id/clock"
                android:textAppearance="@style/TextAppearance.StatusBar.Clock"
+6 −0
Original line number Diff line number Diff line
@@ -65,6 +65,12 @@
            />
    </RelativeLayout>

    <FrameLayout android:id="@+id/system_icons_container"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/status_bar_header_height"
        android:layout_alignParentEnd="true"
        android:layout_marginEnd="16dp"
        />
    <TextView
        android:id="@+id/header_debug_info"
        android:visibility="invisible"
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@
        <include layout="@layout/status_bar_expanded"
            android:layout_width="@dimen/notification_panel_width"
            android:layout_height="match_parent"
            android:layout_gravity="start|top" />
            android:layout_gravity="start|top"
            android:visibility="gone" />
    </com.android.systemui.statusbar.phone.PanelHolder>

</com.android.systemui.statusbar.phone.StatusBarWindowView>
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@
    <dimen name="close_handle_underlap">32dp</dimen>

    <!-- Height of the status bar header bar -->
    <dimen name="status_bar_header_height">48dp</dimen>
    <dimen name="status_bar_header_height">56dp</dimen>

    <!-- Height of the status bar header bar when expanded -->
    <dimen name="status_bar_header_height_expanded">144dp</dimen>
+30 −0
Original line number Diff line number Diff line
@@ -24,9 +24,11 @@ import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;

import com.android.systemui.R;
import com.android.systemui.statusbar.ExpandableView;
@@ -423,6 +425,34 @@ public class NotificationPanelView extends PanelView implements
        }
    }

    @Override
    public void setVisibility(int visibility) {
        int oldVisibility = getVisibility();
        super.setVisibility(visibility);
        if (visibility != oldVisibility) {
            reparentStatusIcons(visibility == VISIBLE);
        }
    }

    /**
     * When the notification panel gets expanded, we need to move the status icons in the header
     * card.
     */
    private void reparentStatusIcons(boolean toHeader) {
        if (mStatusBar == null) {
            return;
        }
        LinearLayout systemIcons = mStatusBar.getSystemIcons();
        if (systemIcons.getParent() != null) {
            ((ViewGroup) systemIcons.getParent()).removeView(systemIcons);
        }
        if (toHeader) {
            mHeader.attachSystemIcons(systemIcons);
        } else {
            mStatusBar.reattachSystemIcons();
        }
    }

    @Override
    protected boolean isScrolledToBottom() {
        if (!isInSettings()) {
Loading