[Android] res: Only occupy one row of space

Edward Wang git at videolan.org
Sun Sep 9 04:31:45 CEST 2012


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Sep  8 22:30:47 2012 -0400| [0e2dc99a4ed01c88c65a4898efd3336ca115a338] | committer: Edward Wang

res: Only occupy one row of space

One row is sufficient to display our widget. (Other widgets like system toggles and built-in music use only one row.)

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0e2dc99a4ed01c88c65a4898efd3336ca115a338
---

 vlc-android/res/layout/vlcwidget.xml  |   14 +++++++-------
 vlc-android/res/values-v14/dimens.xml |    3 +++
 vlc-android/res/values/dimens.xml     |    1 +
 vlc-android/res/xml/vlcwidget.xml     |    2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/vlc-android/res/layout/vlcwidget.xml b/vlc-android/res/layout/vlcwidget.xml
index 382bab4..e8318ce 100644
--- a/vlc-android/res/layout/vlcwidget.xml
+++ b/vlc-android/res/layout/vlcwidget.xml
@@ -3,7 +3,7 @@
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_gravity="center"
-    android:layout_margin="10dp"
+    android:layout_margin="@dimen/widget_margin"
     android:background="@drawable/background"
     android:clickable="true"
     android:clipChildren="true"
@@ -13,8 +13,8 @@
 
     <ImageView
         android:id="@+id/cover"
-        android:layout_width="64dp"
-        android:layout_height="64dp"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
         android:layout_margin="10dp"
         android:src="@drawable/cone" />
 
@@ -54,8 +54,8 @@
 
             <ImageButton
                 android:id="@+id/backward"
-                android:layout_width="40dp"
-                android:layout_height="40dp"
+                android:layout_width="30dp"
+                android:layout_height="30dp"
                 android:background="#00ffffff"
                 android:clickable="true"
                 android:scaleType="fitXY"
@@ -85,8 +85,8 @@
 
             <ImageButton
                 android:id="@+id/forward"
-                android:layout_width="40dp"
-                android:layout_height="40dp"
+                android:layout_width="30dp"
+                android:layout_height="30dp"
                 android:background="#00ffffff"
                 android:clickable="true"
                 android:scaleType="fitXY"
diff --git a/vlc-android/res/values-v14/dimens.xml b/vlc-android/res/values-v14/dimens.xml
new file mode 100644
index 0000000..c1a0e2c
--- /dev/null
+++ b/vlc-android/res/values-v14/dimens.xml
@@ -0,0 +1,3 @@
+<resources>
+	<dimen name="widget_margin">0dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index b1ffd8c..94ef587 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -1,3 +1,4 @@
 <resources>
 	<dimen name="shadow_width">6px</dimen>
+	<dimen name="widget_margin">10dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/vlc-android/res/xml/vlcwidget.xml b/vlc-android/res/xml/vlcwidget.xml
index 81ec674..0e9717a 100644
--- a/vlc-android/res/xml/vlcwidget.xml
+++ b/vlc-android/res/xml/vlcwidget.xml
@@ -1,6 +1,6 @@
 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
     android:minWidth="294dp"
-    android:minHeight="72dp"
+    android:minHeight="40dp"
     android:updatePeriodMillis="86400000"
     android:initialLayout="@layout/vlcwidget">
 </appwidget-provider>
\ No newline at end of file



More information about the Android mailing list