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

Commit c6076a21 authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Gerrit Code Review
Browse files

systemui: move dock battery level views outside systemicons layout

At not the ideal, this at least will match normal battery level view, puttings battery levels
in the correct order. In addition fix two small dock battery bugs:
 -  BatteryLevelTextView not displayed if mode is TEXT
 -  Properly hide DockBatteryMetterView for modes NONE and TEXT
 -  Underline the dock BatteryLevelTextView to differentiate normal from dock text view

Screenshot: https://cloud.ruesga.com/f/74fe240c66/



Change-Id: Idfd3a4bb2f19bd29f9f4dd2b0ea7f645bb531986
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent 393f27e9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -62,6 +62,16 @@
            android:visibility="gone"
            android:textSize="@dimen/battery_level_text_size"
            android:importantForAccessibility="noHideDescendants"/>
        <com.android.systemui.DockBatteryLevelTextView android:id="@+id/dock_battery_level_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="@dimen/header_battery_margin_keyguard"
            android:paddingEnd="@dimen/battery_level_padding_end"
            android:textColor="#ffffff"
            android:visibility="gone"
            android:textSize="@dimen/battery_level_text_size"
            android:importantForAccessibility="noHideDescendants"/>
    </LinearLayout>

    <com.android.keyguard.CarrierText
+9 −0
Original line number Diff line number Diff line
@@ -105,6 +105,15 @@
               android:textColor="#ffffff"
               android:textSize="@dimen/battery_level_text_size" />

            <com.android.systemui.DockBatteryLevelTextView android:id="@+id/dock_battery_level_text"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_gravity="center_vertical"
               android:layout_marginStart="@dimen/header_battery_margin_keyguard"
               android:textColor="#ffffff"
               android:textSize="@dimen/battery_level_text_size"
               android:visibility="gone" />

            <TextView
                android:id="@+id/clock"
                android:textAppearance="@style/TextAppearance.StatusBar.Clock"
+10 −0
Original line number Diff line number Diff line
@@ -77,6 +77,16 @@
            android:textColor="@color/status_bar_battery_level_text_color"
            android:textSize="@dimen/battery_level_text_size"
            android:importantForAccessibility="noHideDescendants"/>
        <com.android.systemui.DockBatteryLevelTextView android:id="@+id/dock_battery_level_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="@dimen/header_battery_margin_expanded"
            android:paddingEnd="@dimen/battery_level_padding_end"
            android:textColor="@color/status_bar_battery_level_text_color"
            android:textSize="@dimen/battery_level_text_size"
            android:importantForAccessibility="noHideDescendants"
            android:visibility="gone"/>
    </LinearLayout>

    <TextView
+0 −8
Original line number Diff line number Diff line
@@ -45,13 +45,5 @@
        android:layout_marginBottom="@dimen/battery_margin_bottom"
        android:layout_marginStart="@dimen/signal_cluster_battery_padding"
        android:visibility="gone" />
    <com.android.systemui.BatteryLevelTextView android:id="@+id/dock_battery_level_text"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:layout_marginStart="@dimen/header_battery_margin_keyguard"
         android:textColor="#ffffff"
         android:textSize="@dimen/battery_level_text_size"
         android:visibility="gone" />

</LinearLayout>
+4 −1
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@ public class BatteryLevelTextView extends TextView implements

    public BatteryLevelTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mRequestedVisibility = getVisibility();
        // setBatteryStateRegistar (if called) will made the view visible and ready to be hidden
        // if the view shouldn't be displayed. Otherwise this view should be hidden from start.
        mRequestedVisibility = GONE;
    }

    public void setForceShown(boolean forceShow) {
@@ -49,6 +51,7 @@ public class BatteryLevelTextView extends TextView implements
    }

    public void setBatteryStateRegistar(BatteryStateRegistar batteryStateRegistar) {
        mRequestedVisibility = VISIBLE;
        mBatteryStateRegistar = batteryStateRegistar;
        if (mAttached) {
            mBatteryStateRegistar.addStateChangedCallback(this);
Loading