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

aleksandar-stefanovic theonewithideas at gmail.com
Wed Jan 11 07:01:30 UTC 2017


 android/source/res/drawable/ic_folder_black_24dp.xml                  |    5 +++++
 android/source/res/layout/file_explorer_grid_item.xml                 |    3 ++-
 android/source/res/layout/file_list_item.xml                          |    3 ++-
 android/source/src/java/org/libreoffice/ui/GridItemAdapter.java       |    8 +++++++-
 android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |    7 ++++++-
 dev/null                                                              |binary
 6 files changed, 22 insertions(+), 4 deletions(-)

New commits:
commit a940c8280d26be030dd7a53cf7b4077430597e8d
Author: aleksandar-stefanovic <theonewithideas at gmail.com>
Date:   Thu Dec 29 20:55:55 2016 +0100

    Folder icon redesign
    
    Replaced old and busted icon design, with Google's generic app icon.
    It is now a vector drawable, which means it will be sharp at any resolution,
    while we only need to keep one tiny xml file for it. No folder thumbnail
    support, but this a welcomed change nontheless.
    
    Change-Id: Ie6e38a6ac8e6cf1bc2d22247c11b5de0bd0d8478
    Reviewed-on: https://gerrit.libreoffice.org/32498
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/android/source/res/drawable/folder.png b/android/source/res/drawable/folder.png
deleted file mode 100644
index 40a6598..0000000
Binary files a/android/source/res/drawable/folder.png and /dev/null differ
diff --git a/android/source/res/drawable/ic_folder_black_24dp.xml b/android/source/res/drawable/ic_folder_black_24dp.xml
new file mode 100644
index 0000000..1a9a16f
--- /dev/null
+++ b/android/source/res/drawable/ic_folder_black_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:autoMirrored="true" android:height="24dp"
+    android:viewportHeight="24.0" android:viewportWidth="24.0"
+    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#FF000000" android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
+</vector>
diff --git a/android/source/res/layout/file_explorer_grid_item.xml b/android/source/res/layout/file_explorer_grid_item.xml
index 8dfb9ed..69e3c0c 100644
--- a/android/source/res/layout/file_explorer_grid_item.xml
+++ b/android/source/res/layout/file_explorer_grid_item.xml
@@ -14,7 +14,8 @@
 
     <ImageView
         android:id="@+id/grid_item_image"
-        tools:src="@drawable/folder"
+        tools:src="@drawable/ic_folder_black_24dp"
+        tools:tint="@color/text_color_secondary"
         android:layout_width="100dp"
         android:layout_height="100dp"
         android:scaleType="fitStart"
diff --git a/android/source/res/layout/file_list_item.xml b/android/source/res/layout/file_list_item.xml
index 3529488..7d703be 100644
--- a/android/source/res/layout/file_list_item.xml
+++ b/android/source/res/layout/file_list_item.xml
@@ -12,7 +12,8 @@
     android:orientation="horizontal" >
     <ImageView
         android:id="@+id/file_list_item_icon"
-        tools:src="@drawable/folder"
+        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"
diff --git a/android/source/src/java/org/libreoffice/ui/GridItemAdapter.java b/android/source/src/java/org/libreoffice/ui/GridItemAdapter.java
index b083de4..6385769 100644
--- a/android/source/src/java/org/libreoffice/ui/GridItemAdapter.java
+++ b/android/source/src/java/org/libreoffice/ui/GridItemAdapter.java
@@ -10,6 +10,7 @@
 package org.libreoffice.ui;
 
 import android.content.Context;
+import android.support.v4.content.ContextCompat;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -54,6 +55,8 @@ public class GridItemAdapter extends BaseAdapter {
         LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                 Context.LAYOUT_INFLATER_SERVICE);
 
+        Context context = inflater.getContext();
+
         View gridView;
 
         if (convertView == null) {
@@ -74,7 +77,10 @@ public class GridItemAdapter extends BaseAdapter {
             .findViewById(R.id.grid_item_image);
         if (filePaths.get(position).isDirectory()) { // Is a folder
             // Default view is a generic folder icon.
-            imageView.setImageResource(R.drawable.folder);
+            imageView.setImageResource(R.drawable.ic_folder_black_24dp);
+            //for tint
+            imageView.setColorFilter(ContextCompat.getColor(context,R.color.text_color_secondary));
+
         } else {
             /*
             File thumbnailFile = new File( filePaths[position].getParent() , "."
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index d0681bd..6580d53 100644
--- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -20,6 +20,7 @@ import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Handler;
 import android.preference.PreferenceManager;
+import android.support.v4.content.ContextCompat;
 import android.support.v4.widget.DrawerLayout;
 import android.support.v7.app.ActionBar;
 import android.support.v7.app.ActionBarDrawerToggle;
@@ -730,6 +731,8 @@ public class LibreOfficeUIActivity extends AppCompatActivity {
             LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                     Context.LAYOUT_INFLATER_SERVICE);
 
+            Context context = inflater.getContext();
+
             View listItem;
 
             if (convertView == null) {
@@ -808,7 +811,9 @@ public class LibreOfficeUIActivity extends AppCompatActivity {
             if (filePaths.get(position).isDirectory()) {
                 //Eventually have thumbnails of each sub file on a black circle
                 //For now just a folder icon
-                imageView.setImageResource(R.drawable.folder);
+                imageView.setImageResource(R.drawable.ic_folder_black_24dp);
+                //for tint
+                imageView.setColorFilter(ContextCompat.getColor(context,R.color.text_color_secondary));
             }
             //imageView.setClickable(true);
             return listItem;


More information about the Libreoffice-commits mailing list