Added icon for files synchronizing; folders use it whenever downloading or uploading...
authorDavid A. Velasco <dvelasco@solidgear.es>
Tue, 14 Jul 2015 09:28:47 +0000 (11:28 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 25 Sep 2015 13:13:38 +0000 (15:13 +0200)
res/drawable/synchronizing_file_indicator.png [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/FileListListAdapter.java

diff --git a/res/drawable/synchronizing_file_indicator.png b/res/drawable/synchronizing_file_indicator.png
new file mode 100644 (file)
index 0000000..947cba7
Binary files /dev/null and b/res/drawable/synchronizing_file_indicator.png differ
index 5e94e0f..8d05714 100644 (file)
@@ -249,24 +249,38 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter {
                             mTransferServiceGetter.getFileDownloaderBinder();\r
                     FileUploaderBinder uploaderBinder =\r
                             mTransferServiceGetter.getFileUploaderBinder();\r
-                    boolean downloading = (downloaderBinder != null &&\r
-                            downloaderBinder.isDownloading(mAccount, file));\r
                     OperationsServiceBinder opsBinder =\r
                             mTransferServiceGetter.getOperationsServiceBinder();\r
-                    downloading |= (opsBinder != null &&\r
+                    boolean downloading = (downloaderBinder != null &&\r
+                            downloaderBinder.isDownloading(mAccount, file));\r
+                    boolean uploading = (uploaderBinder != null &&\r
+                            uploaderBinder.isUploading(mAccount, file));\r
+                    boolean synchronizing = (opsBinder != null &&\r
                             opsBinder.isSynchronizing(mAccount, file.getRemotePath()));\r
-                    if (downloading) {\r
+\r
+                    localStateView.setVisibility(View.INVISIBLE);   // default first\r
+\r
+                    if (file.isFolder()) {\r
+                        if (synchronizing || downloading || uploading) {\r
+                            localStateView.setImageResource(R.drawable.synchronizing_file_indicator);\r
+                            localStateView.setVisibility(View.VISIBLE);\r
+                        }\r
+\r
+                    } else if (synchronizing) {\r
+                        localStateView.setImageResource(R.drawable.synchronizing_file_indicator);\r
+                        localStateView.setVisibility(View.VISIBLE);\r
+\r
+                    } else if (downloading) {\r
                         localStateView.setImageResource(R.drawable.downloading_file_indicator);\r
                         localStateView.setVisibility(View.VISIBLE);\r
-                    } else if (uploaderBinder != null &&\r
-                            uploaderBinder.isUploading(mAccount, file)) {\r
+\r
+                    } else if (uploading) {\r
                         localStateView.setImageResource(R.drawable.uploading_file_indicator);\r
                         localStateView.setVisibility(View.VISIBLE);\r
+\r
                     } else if (file.isDown()) {\r
                         localStateView.setImageResource(R.drawable.local_file_indicator);\r
                         localStateView.setVisibility(View.VISIBLE);\r
-                    } else {\r
-                        localStateView.setVisibility(View.INVISIBLE);\r
                     }\r
 \r
                     // share with me icon\r