Эх сурвалжийг харах

Fix magic numbers in notification_with_progress_bar.xml #12

Divay Prakash 8 жил өмнө
parent
commit
3c698a7b39

+ 6 - 6
res/layout/notification_with_progress_bar.xml

@@ -28,10 +28,10 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="center"
-        android:minHeight="64dp"
+        android:minHeight="@dimen/notification_with_progress_bar_layout_height"
         android:orientation="vertical"
-        android:paddingRight="12dp"
-        android:paddingLeft="12dp"
+        android:paddingRight="@dimen/notification_with_progress_bar_layout"
+        android:paddingLeft="@dimen/notification_with_progress_bar_layout"
         >
 		<TextView android:id="@+id/title"
 			android:layout_width="match_parent"
@@ -44,8 +44,8 @@
         <TextView android:id="@+id/text"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="-2dp"
-            android:layout_marginBottom="-2dp"
+            android:layout_marginTop="@dimen/standard_eighth_margin_negative"
+            android:layout_marginBottom="@dimen/standard_eighth_margin_negative"
             android:singleLine="true"
             android:fadingEdge="horizontal"
             android:ellipsize="marquee"
@@ -53,7 +53,7 @@
             />
         <FrameLayout android:id="@+id/progressHolder"
             android:layout_width="match_parent"
-            android:layout_height="12dp"
+            android:layout_height="@dimen/notification_with_progress_bar_layout"
             >
             <!--  the FrameLayout is needed to change visibility of the
             	progress bar in Android 2.2, even though 

+ 3 - 0
res/values/dims.xml

@@ -42,6 +42,7 @@
     <dimen name="standard_half_margin">8dp</dimen>
     <dimen name="standard_quarter_margin">4dp</dimen>
     <dimen name="standard_eighth_margin">2dp</dimen>
+    <dimen name="standard_eighth_margin_negative">-2dp</dimen>
     <dimen name="min_list_item_size">56dp</dimen>
     <dimen name="standard_list_item_size">72dp</dimen>
 
@@ -101,4 +102,6 @@
     <dimen name="log_item_text_size">22dp</dimen>
 
     <dimen name="seek_bar_height">32dp</dimen>
+    <dimen name="notification_with_progress_bar_layout">12dp</dimen>
+    <dimen name="notification_with_progress_bar_layout_height">64dp</dimen>
 </resources>