[Libreoffice-commits] core.git: android/source

brainbreaker gautamprajapati06 at gmail.com
Wed Feb 15 08:47:28 UTC 2017


 android/source/res/layout/file_list_item.xml    |   19 ++++++++++++++-----
 android/source/res/layout/item_recent_files.xml |   16 ++++++++++------
 android/source/res/values/dimens.xml            |    3 +++
 android/source/res/values/themes.xml            |    2 +-
 4 files changed, 28 insertions(+), 12 deletions(-)

New commits:
commit 36a43c356e33ce97017801dc25f711b576486a11
Author: brainbreaker <gautamprajapati06 at gmail.com>
Date:   Sun Feb 12 22:29:21 2017 +0530

    Fixed the margins of list items of File Recycler View
    
    Screenshots of the change:-
    Before:
    1. https://s19.postimg.org/bbs91keyr/Screenshot_20170212_182941.png
    2. https://s19.postimg.org/k5j5io1xf/Screenshot_20170212_183334.png
    Now:
    1. https://s19.postimg.org/4o08spkub/Screenshot_20170212_222359.png
    2. https://s19.postimg.org/5p0hhu1tv/Screenshot_20170212_222406.png
    
    Change-Id: I3137ce2648c4dda30d7bbe93245618a83e9048c0
    Reviewed-on: https://gerrit.libreoffice.org/34175
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Aleksandar Stefanović <theonewithideas at gmail.com>
    Tested-by: Aleksandar Stefanović <theonewithideas at gmail.com>

diff --git a/android/source/res/layout/file_list_item.xml b/android/source/res/layout/file_list_item.xml
index 7d703be..a2dcfdb 100644
--- a/android/source/res/layout/file_list_item.xml
+++ b/android/source/res/layout/file_list_item.xml
@@ -9,14 +9,19 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="48dp"
-    android:orientation="horizontal" >
+    android:orientation="horizontal"
+    android:layout_marginStart="@dimen/list_item_margin"
+    android:layout_marginLeft="@dimen/list_item_margin"
+    android:layout_marginEnd="@dimen/list_item_margin"
+    android:layout_marginRight="@dimen/list_item_margin">
     <ImageView
         android:id="@+id/file_list_item_icon"
         tools:src="@drawable/ic_folder_black_24dp"
         tools:tint="@color/text_color_secondary"
         android:layout_height="match_parent"
-        android:layout_width="32dp"
-        android:layout_margin="8dp"
+        android:layout_width="@dimen/file_icon_width"
+        android:layout_marginEnd="@dimen/file_icon_margin_end"
+        android:layout_marginRight="@dimen/file_icon_margin_end"
         android:layout_gravity="center"
         android:contentDescription="@string/file_icon_desc" />
     <LinearLayout
@@ -29,7 +34,9 @@
             style="@style/ListItemText"
             android:layout_height="match_parent"
             android:layout_width="0dp"
-            android:layout_weight="2" />
+            android:layout_weight="2"
+            android:ellipsize="end"
+            android:maxLines="1"/>
         <TextView
             android:id="@+id/file_list_item_size"
             tools:text="filesize"
@@ -43,6 +50,8 @@
             style="@style/ListItemText"
             android:layout_height="match_parent"
             android:layout_width="0dp"
-            android:layout_weight="2" />
+            android:layout_weight="2"
+            android:ellipsize="end"
+            android:maxLines="1"/>
     </LinearLayout>
 </LinearLayout>
diff --git a/android/source/res/layout/item_recent_files.xml b/android/source/res/layout/item_recent_files.xml
index fa966d8..b374ba5 100644
--- a/android/source/res/layout/item_recent_files.xml
+++ b/android/source/res/layout/item_recent_files.xml
@@ -12,23 +12,27 @@
     android:layout_height="48dp"
     android:orientation="horizontal"
     android:background="?android:attr/selectableItemBackground"
+    android:layout_marginStart="@dimen/list_item_margin"
+    android:layout_marginLeft="@dimen/list_item_margin"
+    android:layout_marginEnd="@dimen/list_item_margin"
+    android:layout_marginRight="@dimen/list_item_margin"
     tools:ignore="UseCompoundDrawables">
     <!--using compound drawables is ignored because more control over the drawable size is needed-->
 
     <ImageView
         android:layout_width="32dp"
         android:layout_height="wrap_content"
-        android:layout_margin="8dp"
         android:layout_gravity="center_vertical"
+        android:layout_marginEnd="@dimen/file_icon_margin_end"
+        android:layout_marginRight="@dimen/file_icon_margin_end"
         android:adjustViewBounds="true"
         android:id="@+id/imageView"
         android:contentDescription="@string/file_icon_desc"/>
-
-
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:id="@+id/textView"
-        style="@style/ListItemText"/>
-
-</LinearLayout>
\ No newline at end of file
+        style="@style/ListItemText"
+        android:maxLines="1"
+        android:ellipsize="end"/>
+</LinearLayout>
diff --git a/android/source/res/values/dimens.xml b/android/source/res/values/dimens.xml
index 1e5d771..7c48f2b 100644
--- a/android/source/res/values/dimens.xml
+++ b/android/source/res/values/dimens.xml
@@ -5,4 +5,7 @@
     <dimen name="text_selection_handle_width">30dp</dimen>
     <dimen name="text_selection_handle_height">44dp</dimen>
     <dimen name="text_selection_handle_shadow">2dp</dimen>
+    <dimen name="file_icon_margin_end">8dp</dimen>
+    <dimen name="list_item_margin">8dp</dimen>
+    <dimen name="file_icon_width">32dp</dimen>
 </resources>
diff --git a/android/source/res/values/themes.xml b/android/source/res/values/themes.xml
index e5287a8..4036d97 100644
--- a/android/source/res/values/themes.xml
+++ b/android/source/res/values/themes.xml
@@ -8,7 +8,7 @@
     <style name="ListItemText">
         <item name="android:gravity">center</item>
         <item name="android:textColor">@android:color/black</item>
-        <item name="android:textSize">15sp</item>
+        <item name="android:textSize">14sp</item>
     </style>
 
     <style name="LibreOfficeTheme.Toolbar" parent="Theme.AppCompat.Light.NoActionBar">


More information about the Libreoffice-commits mailing list