OSDN Git Service

Update the UI for battery header
authorjackqdyulei <jackqdyulei@google.com>
Tue, 27 Jun 2017 01:40:49 +0000 (18:40 -0700)
committerjackqdyulei <jackqdyulei@google.com>
Wed, 28 Jun 2017 17:29:01 +0000 (10:29 -0700)
1. Make battery icon align to the end and make text layout
take all the other space.
2. Update the spec based on red line.

Bug: 63037934
Test: Screenshot
Change-Id: I1adbf5ce3e54712cbdc276db2357c7a24b48fe65

res/layout/battery_header.xml

index b7a8199..d59476c 100644 (file)
     style="@style/EntityHeader">
 
     <LinearLayout
-        android:layout_width="216dp"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="48dp"
-        android:layout_marginEnd="12dp"
+        android:layout_weight="1"
+        android:layout_marginStart="56dp"
         android:orientation="vertical">
 
         <TextView
             android:id="@+id/battery_percent"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="12dp"
             android:fontFamily="@*android:string/config_headlineFontFamily"
 
         <TextView
             android:id="@+id/summary1"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="12dp"
+            android:layout_marginTop="8dp"
             android:textAppearance="@android:style/TextAppearance.Material.Small"/>
 
         <TextView
             android:id="@+id/summary2"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:textAppearance="@android:style/TextAppearance.Material.Small"/>
 
@@ -61,7 +61,6 @@
         android:id="@+id/battery_header_icon"
         android:layout_width="@dimen/battery_meter_width"
         android:layout_height="@dimen/battery_meter_height"
-        android:layout_gravity="end"
-        android:layout_marginEnd="24dp"/>
+        android:layout_marginEnd="16dp"/>
 
 </LinearLayout>
\ No newline at end of file