OSDN Git Service

Settings: Improve vibrator intensity dialog layout
authorZhao Wei Liew <zhaoweiliew@gmail.com>
Fri, 1 Jul 2016 16:48:22 +0000 (00:48 +0800)
committerZhao Wei Liew <zhaoweiliew@gmail.com>
Wed, 27 Jul 2016 09:47:24 +0000 (17:47 +0800)
 - Remove redundant 'Vibrator intensity' text
 - Align the text and seekbars
 - Get rid of the ScrollView
 - Clean up

Visual:
http://imgur.com/YB7Ez3m

Change-Id: I4d80f7df2f18b580eaef1ca44ce0560e044ee065

res/layout/vibrator_intensity.xml
res/values/cm_strings.xml

index dcbc676..171f90e 100644 (file)
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_height="match_parent"
+    android:layout_width="match_parent"
+    android:paddingTop="24dp"
+    android:paddingBottom="24dp"
+    android:paddingEnd="24dp" >
 
-    <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center_horizontal"
-            android:paddingBottom="20dip">
+    <SeekBar
+        android:id="@*android:id/seekbar"
+        android:layout_height="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_alignParentStart="true"
+        android:layout_marginStart="8dp"
+        android:layout_toStartOf="@id/value" />
 
-        <TextView android:id="@+id/text"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/vibrator_intensity_title"
-                android:paddingTop="10dip"
-                android:paddingLeft="20dip"
-                android:paddingRight="20dip" />
-        <TextView android:id="@+id/value"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:paddingTop="10dip"
-                android:paddingLeft="20dip"
-                android:paddingRight="20dip" />
-        <SeekBar android:id="@*android:id/seekbar"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@id/text"
-                android:paddingTop="2dip"
-                android:paddingLeft="20dip"
-                android:paddingRight="20dip" />
+    <TextView
+        android:id="@+id/value"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:layout_marginStart="4dp"
+        android:gravity="center_horizontal"
+        android:minEms="2" />
 
-        <TextView
-                android:id="@+id/warning_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_below="@*android:id/seekbar"
-                android:paddingTop="8dip"
-                android:gravity="center"
-                android:textSize="15dp" />
+    <TextView
+        android:id="@+id/warning_text"
+        android:layout_below="@*android:id/seekbar"
+        android:layout_height="wrap_content"
+        android:layout_width="match_parent"
+        android:layout_marginStart="24dp"
+        android:layout_marginTop="24dp" />
 
-    </RelativeLayout>
-</ScrollView>
+</RelativeLayout>
index cd091fd..cf5ad54 100644 (file)
 
     <!-- Hardware tunables - Vibrator intensity -->
     <string name="vibrator_intensity_title">Vibrator intensity</string>
-    <string name="vibrator_warning">Values higher than %1$d are not recommended</string>
+    <string name="vibrator_warning">Values higher than %1$d%% are not recommended</string>
 
     <!-- Hardware tunables - Color calibration -->
     <string name="color_calibration_title">Color calibration</string>