Эх сурвалжийг харах

resolves #1078 - Empty content screen icon colors

AndyScherzinger 7 жил өмнө
parent
commit
51c2f1d83d

+ 2 - 1
src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.java

@@ -171,7 +171,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C
                 listFragment.setMessageForEmptyList(
                         R.string.file_list_empty_headline,
                         R.string.file_list_empty_moving,
-                        R.drawable.ic_list_empty_create_folder
+                        R.drawable.ic_list_empty_create_folder,
+                        true
                 );
             } else {
                 listFragment.setEmptyListLoadingMessage();

+ 20 - 3
src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java

@@ -626,14 +626,28 @@ public class ExtendedListFragment extends Fragment
         }
     }
 
+    /**
+     * displays an empty list information with a headline, a message and a not to be tinted icon.
+     *
+     * @param headline the headline
+     * @param message  the message
+     * @param icon     the icon to be shown
+     */
+    public void setMessageForEmptyList(@StringRes final int headline, @StringRes final int message,
+                                       @DrawableRes final int icon) {
+        setMessageForEmptyList(headline, message, icon, false);
+    }
+
     /**
      * displays an empty list information with a headline, a message and an icon.
      *
      * @param headline the headline
      * @param message  the message
      * @param icon     the icon to be shown
+     * @param tintIcon flag if the given icon should be tinted with primary color
      */
-    public void setMessageForEmptyList(@StringRes final int headline, @StringRes final int message, @DrawableRes final int icon) {
+    public void setMessageForEmptyList(@StringRes final int headline, @StringRes final int message,
+                                       @DrawableRes final int icon, final boolean tintIcon) {
         new Handler(Looper.getMainLooper()).post(new Runnable() {
             @Override
             public void run() {
@@ -642,7 +656,9 @@ public class ExtendedListFragment extends Fragment
                     mEmptyListHeadline.setText(headline);
                     mEmptyListMessage.setText(message);
 
-                    mEmptyListIcon.setImageDrawable(DisplayUtils.tintDrawable(icon, R.color.primary));
+                    if (tintIcon) {
+                        mEmptyListIcon.setImageDrawable(DisplayUtils.tintDrawable(icon, R.color.primary));
+                    }
 
                     mEmptyListIcon.setVisibility(View.VISIBLE);
                     mEmptyListProgress.setVisibility(View.GONE);
@@ -661,7 +677,8 @@ public class ExtendedListFragment extends Fragment
                     setMessageForEmptyList(
                             R.string.file_list_empty_headline,
                             R.string.file_list_empty,
-                            R.drawable.ic_list_empty_folder
+                            R.drawable.ic_list_empty_folder,
+                            true
                     );
                 } else if (searchType == SearchType.FILE_SEARCH) {
                     setMessageForEmptyList(R.string.file_list_empty_headline_server_search,

+ 1 - 1
src/main/java/com/owncloud/android/ui/fragment/LocalFileListFragment.java

@@ -99,7 +99,7 @@ public class LocalFileListFragment extends ExtendedListFragment {
         setSwipeEnabled(false); // Disable pull-to-refresh
         setFabEnabled(false); // Disable FAB
         setMessageForEmptyList(R.string.file_list_empty_headline, R.string.local_file_list_empty,
-                R.drawable.ic_list_empty_folder);
+                R.drawable.ic_list_empty_folder, true);
         Log_OC.i(TAG, "onCreateView() end");
         return v;
     }

+ 1 - 1
src/main/java/com/owncloud/android/ui/fragment/UploadListFragment.java

@@ -67,7 +67,7 @@ public class UploadListFragment extends ExpandableListFragment {
         getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
         setMessageForEmptyList(
                 R.string.upload_list_empty_headline, R.string.upload_list_empty_text_auto_upload,
-                R.drawable.ic_list_empty_upload
+                R.drawable.ic_list_empty_upload, true
         );
         setOnRefreshListener(this);
         return v;

+ 0 - 1
src/main/res/layout/empty_list.xml

@@ -34,7 +34,6 @@
         android:layout_height="72dp"
         android:contentDescription="@string/file_list_folder"
         android:src="@drawable/ic_list_empty_folder"
-        android:tint="@color/primary"
         android:visibility="gone"/>
 
     <ProgressBar