Pārlūkot izejas kodu

Grant that UI is correctly refreshed on rotations

David A. Velasco 9 gadi atpakaļ
vecāks
revīzija
6ac53bc1ba

+ 6 - 0
src/com/owncloud/android/ui/activity/ShareActivity.java

@@ -245,6 +245,12 @@ public class ShareActivity extends FileActivity
             searchShareesFragment.refreshUsersOrGroupsListFromDB();
         }
 
+        EditShareFragment editShareFragment = getEditShareFragment();
+        if (editShareFragment != null &&
+                editShareFragment.isAdded())    {
+            editShareFragment.refreshUiFromDB();
+        }
+
     }
 
     /**

+ 13 - 0
src/com/owncloud/android/ui/fragment/EditShareFragment.java

@@ -363,6 +363,19 @@ public class EditShareFragment extends Fragment {
     }
 
 
+    /**
+     * Get {@link OCShare} instance from DB and updates the UI.
+     *
+     * Depends on the parent Activity provides a {@link com.owncloud.android.datamodel.FileDataStorageManager}
+     * instance ready to use. If not ready, does nothing.
+     */
+    public void refreshUiFromDB() {
+        if (getView() != null) {
+            refreshUiFromDB(getView());
+        }
+    }
+
+
     /**
      * Get {@link OCShare} instance from DB and updates the UI.
      *