Fixed visibility of progress circle for refresh
authorDavid A. Velasco <dvelasco@solidgear.es>
Fri, 31 Jan 2014 11:22:49 +0000 (12:22 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Fri, 31 Jan 2014 11:22:49 +0000 (12:22 +0100)
owncloud-android-library
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index 8ab453d..d731ff0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8ab453d630458fc6cdcd1bf68493d82365f1c6d3
+Subproject commit d731ff0e6638a168e10a92da3915fcdd2f65aa37
index 3cdf19b..cc7ab55 100644 (file)
@@ -204,7 +204,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         // Action bar setup
         mDirectories = new CustomArrayAdapter<String>(this, R.layout.sherlock_spinner_dropdown_item);
         getSupportActionBar().setHomeButtonEnabled(true);       // mandatory since Android ICS, according to the official documentation
-        setSupportProgressBarIndeterminateVisibility(mSyncInProgress);    // always AFTER setContentView(...) ; to work around bug in its implementation
+        setSupportProgressBarIndeterminateVisibility(mSyncInProgress || mRefreshSharesInProgress);    // always AFTER setContentView(...) ; to work around bug in its implementation
         
         Log_OC.d(TAG, "onCreate() end");
     }
@@ -964,19 +964,13 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                     setFile(currentFile);
                 }
                 
-                if (!mRefreshSharesInProgress) {
-                    /// get the shared files
-                    if (isSharedSupported()) {
-                        startGetShares();
-                    }
-                    setSupportProgressBarIndeterminateVisibility(inProgress);
-                } else {
-                    setSupportProgressBarIndeterminateVisibility(true);
+                if (synchResult != null && synchResult.isSuccess() && isSharedSupported()) {
+                    startGetShares();
                 }
                 
                 removeStickyBroadcast(intent);
                 mSyncInProgress = inProgress;
-
+                setSupportProgressBarIndeterminateVisibility(mSyncInProgress || mRefreshSharesInProgress);
             }
             
             if (synchResult != null) {
@@ -1564,8 +1558,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         startService(intent);
         
         mRefreshSharesInProgress = true;
-        setSupportProgressBarIndeterminateVisibility(true);
-        
     }
     
 }