[Android] Fix layout size, emptyview position & scrolling

Geoffrey Métais git at videolan.org
Mon Jul 6 10:45:40 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jul  6 00:15:52 2015 +0200| [1fd9b39c80200bdc0cda7bdabbe5024968927d6f] | committer: Geoffrey Métais

Fix layout size, emptyview position & scrolling

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

 vlc-android/res/layout/file_picker_activity.xml |   10 ++++------
 vlc-android/res/layout/file_picker_fragment.xml |   10 +++++-----
 vlc-android/res/values-sw600dp/dimens.xml       |    2 ++
 vlc-android/res/values/dimens.xml               |    4 +++-
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/vlc-android/res/layout/file_picker_activity.xml b/vlc-android/res/layout/file_picker_activity.xml
index 589e5b8..33deb98 100644
--- a/vlc-android/res/layout/file_picker_activity.xml
+++ b/vlc-android/res/layout/file_picker_activity.xml
@@ -1,14 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="800dp"
-    android:layout_height="800dp">
+    android:orientation="vertical" android:layout_width="@dimen/file_picker_width"
+    android:layout_height="@dimen/file_picker_height">
 
     <FrameLayout
         android:id="@+id/fragment_placeholder"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:minWidth="@dimen/file_picker"
-        android:minHeight="@dimen/file_picker"/>
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
 
 </LinearLayout>
\ No newline at end of file
diff --git a/vlc-android/res/layout/file_picker_fragment.xml b/vlc-android/res/layout/file_picker_fragment.xml
index e333c4b..121826f 100644
--- a/vlc-android/res/layout/file_picker_fragment.xml
+++ b/vlc-android/res/layout/file_picker_fragment.xml
@@ -3,8 +3,8 @@
 <org.videolan.vlc.widget.SwipeRefreshLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/swipeLayout"
-    android:layout_width="800dp"
-    android:layout_height="800dp">
+    android:layout_width="@dimen/file_picker_width"
+    android:layout_height="@dimen/file_picker_height">
     <FrameLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent">
@@ -15,9 +15,9 @@
             android:visibility="gone"/>
         <TextView
             android:id="@+id/android:empty"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:gravity="center"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
             android:text="@string/network_connection_needed"/>
     </FrameLayout>
 </org.videolan.vlc.widget.SwipeRefreshLayout>
\ No newline at end of file
diff --git a/vlc-android/res/values-sw600dp/dimens.xml b/vlc-android/res/values-sw600dp/dimens.xml
index a654209..e6a0b43 100644
--- a/vlc-android/res/values-sw600dp/dimens.xml
+++ b/vlc-android/res/values-sw600dp/dimens.xml
@@ -10,4 +10,6 @@
     <dimen name="media_ctrl_margin_top">30dp</dimen>
     <dimen name="images_margin_sides">60dp</dimen>
     <dimen name="overlay_margin">10dp</dimen>
+
+    <dimen name="file_picker_width">600dip</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 7bc8a36..c48eaf8 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -29,7 +29,9 @@
     <dimen name="tv_overscan_vertical">0dp</dimen>
     <dimen name="tv_overscan_horizontal">0dp</dimen>
 
-    <dimen name="file_picker">600dip</dimen>
+    <dimen name="file_picker_width">300dip</dimen>
+    <!-- -1px is fill/match_parent -->
+    <dimen name="file_picker_height">-1px</dimen>
 
     <!-- Default -->
     <dimen name="default_margin">16dp</dimen>



More information about the Android mailing list