Jelajahi Sumber

Merge pull request #2354 from nextcloud/enlargeAutoUploadHeaderIcon

UX: improve auto upload list header
Andy Scherzinger 7 tahun lalu
induk
melakukan
9a97e436d8

+ 42 - 21
src/main/java/com/owncloud/android/ui/adapter/SyncedFolderAdapter.java

@@ -22,6 +22,7 @@
 package com.owncloud.android.ui.adapter;
 
 import android.content.Context;
+import android.support.annotation.Nullable;
 import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -43,6 +44,9 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
 /**
  * Adapter to display all auto-synced folders and/or instant upload media folders.
  */
@@ -111,11 +115,11 @@ public class SyncedFolderAdapter extends SectionedRecyclerViewAdapter<SyncedFold
         holder.title.setText(mSyncFolderItems.get(section).getFolderName());
 
         if (MediaFolderType.VIDEO == mSyncFolderItems.get(section).getType()) {
-            holder.type.setImageResource(R.drawable.ic_video_18dp);
+            holder.type.setImageResource(R.drawable.video_32dp);
         } else if (MediaFolderType.IMAGE == mSyncFolderItems.get(section).getType()) {
-            holder.type.setImageResource(R.drawable.ic_image_18dp);
+            holder.type.setImageResource(R.drawable.image_32dp);
         } else {
-            holder.type.setImageResource(R.drawable.ic_folder_star_18dp);
+            holder.type.setImageResource(R.drawable.folder_star_32dp);
         }
 
         holder.syncStatusButton.setVisibility(View.VISIBLE);
@@ -195,28 +199,45 @@ public class SyncedFolderAdapter extends SectionedRecyclerViewAdapter<SyncedFold
     }
 
     static class MainViewHolder extends RecyclerView.ViewHolder {
-        private final ImageView image;
-        private final TextView title;
-        private final ImageView type;
-        private final ImageButton menuButton;
-        private final ImageButton syncStatusButton;
-        private final LinearLayout counterBar;
-        private final TextView counterValue;
-        private final ImageView thumbnailDarkener;
+        @Nullable
+        @BindView(R.id.thumbnail)
+        public ImageView image;
+
+        @Nullable
+        @BindView(R.id.title)
+        public TextView title;
+
+        @Nullable
+        @BindView(R.id.type)
+        public ImageView type;
+
+        @Nullable
+        @BindView(R.id.settingsButton)
+        public ImageButton menuButton;
+
+        @Nullable
+        @BindView(R.id.syncStatusButton)
+        public ImageButton syncStatusButton;
+
+        @Nullable
+        @BindView(R.id.counterLayout)
+        public LinearLayout counterBar;
+
+        @Nullable
+        @BindView(R.id.counter)
+        public TextView counterValue;
+
+        @Nullable
+        @BindView(R.id.thumbnailDarkener)
+        public ImageView thumbnailDarkener;
 
-        private final RelativeLayout mainHeaderContainer;
+        @Nullable
+        @BindView(R.id.header_container)
+        public RelativeLayout mainHeaderContainer;
 
         private MainViewHolder(View itemView) {
             super(itemView);
-            mainHeaderContainer = (RelativeLayout) itemView.findViewById(R.id.header_container);
-            image = (ImageView) itemView.findViewById(R.id.thumbnail);
-            title = (TextView) itemView.findViewById(R.id.title);
-            type = (ImageView) itemView.findViewById(R.id.type);
-            menuButton = (ImageButton) itemView.findViewById(R.id.settingsButton);
-            syncStatusButton = (ImageButton) itemView.findViewById(R.id.syncStatusButton);
-            counterBar = (LinearLayout) itemView.findViewById(R.id.counterLayout);
-            counterValue = (TextView) itemView.findViewById(R.id.counter);
-            thumbnailDarkener = (ImageView) itemView.findViewById(R.id.thumbnailDarkener);
+            ButterKnife.bind(this, itemView);
         }
     }
 

TEMPAT SAMPAH
src/main/res/drawable-hdpi/ic_image_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-hdpi/ic_video_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-mdpi/ic_image_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-mdpi/ic_video_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xhdpi/ic_image_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xhdpi/ic_video_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xxhdpi/ic_image_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xxhdpi/ic_video_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xxxhdpi/ic_image_18dp.png


TEMPAT SAMPAH
src/main/res/drawable-xxxhdpi/ic_video_18dp.png


+ 8 - 0
src/main/res/drawable/folder_star_32dp.xml

@@ -0,0 +1,8 @@
+<!-- drawable/folder_star.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path android:fillColor="#757575" android:pathData="M20,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8A2,2 0 0,0 20,6M17.94,17L15,15.28L12.06,17L12.84,13.67L10.25,11.43L13.66,11.14L15,8L16.34,11.14L19.75,11.43L17.16,13.67L17.94,17Z" />
+</vector>

+ 8 - 0
src/main/res/drawable/image_32dp.xml

@@ -0,0 +1,8 @@
+<!-- drawable/image.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path android:fillColor="#757575" android:pathData="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" />
+</vector>

+ 8 - 0
src/main/res/drawable/video_32dp.xml

@@ -0,0 +1,8 @@
+<!-- drawable/video.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+    <path android:fillColor="#757575" android:pathData="M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z" />
+</vector>

+ 5 - 7
src/main/res/layout/synced_folders_item_header.xml

@@ -46,14 +46,12 @@
 
             <ImageView
                 android:id="@+id/type"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_width="32dp"
+                android:layout_height="32dp"
                 android:layout_gravity="start|center_vertical"
-                android:paddingRight="@dimen/standard_half_padding"
-                android:paddingEnd="@dimen/standard_half_padding"
-                android:paddingStart="@dimen/zero"
-                android:paddingLeft="@dimen/zero"
-                android:src="@drawable/ic_image_18dp"
+                android:layout_marginRight="24dp"
+                android:layout_marginEnd="24dp"
+                android:src="@drawable/image_32dp"
                 android:contentDescription="@string/synced_folders_type"/>
 
             <TextView