Improved error messages in gallery for images that can not be loaded
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / activity / FileDisplayActivity.java
index 3311822..97660e7 100644 (file)
@@ -211,6 +211,19 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
         mDualPane = (findViewById(R.id.file_details_container) != null);\r
         if (mDualPane) {\r
             initFileDetailsInDualPane();\r
+        } else {\r
+            // quick patchES to fix problem in turn from landscape to portrait, when a file is selected in the right pane\r
+            // TODO serious refactorization in activities and fragments providing file browsing and handling \r
+            if (mCurrentFile != null) {\r
+                onFileClick(mCurrentFile);\r
+                mCurrentFile = null;\r
+            }\r
+            Fragment rightPanel = getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG);\r
+            if (rightPanel != null) {\r
+                FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
+                transaction.remove(rightPanel);\r
+                transaction.commit();\r
+            }\r
         }\r
             \r
         // Action bar setup\r
@@ -265,7 +278,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
         startActivity(intent);  // the new activity won't be created until this.onStart() and this.onResume() are finished;\r
     }\r
 \r
-\r
+    \r
     /**\r
      *  Load of state dependent of the existence of an ownCloud account\r
      */\r
@@ -561,7 +574,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
     }\r
 \r
     @Override\r
-    protected void onResume() {\r
+    public void onResume() {\r
         Log.d(getClass().toString(), "onResume() start");\r
         super.onResume();\r
 \r
@@ -605,7 +618,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
 \r
     \r
     @Override\r
-    protected void onPause() {\r
+    public void onPause() {\r
         Log.d(getClass().toString(), "onPause() start");\r
         super.onPause();\r
         if (mSyncBroadcastReceiver != null) {\r
@@ -1433,22 +1446,6 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
     }\r
 \r
 \r
-    @Override\r
-    public void notifySuccessfulDownload(OCFile file, Intent intent, boolean success) {\r
-        /*\r
-        if (success) {\r
-            if (mWaitingToPreview != null) {\r
-                FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\r
-                transaction.replace(R.id.file_details_container, new PreviewMediaFragment(file, AccountUtils.getCurrentOwnCloudAccount(this)), FileDetailFragment.FTAG);\r
-                transaction.commit();\r
-                mWaitingToPreview = null;\r
-            }\r
-        }\r
-        mDownloadFinishReceiver.onReceive(this, intent);\r
-         */\r
-    }\r
-\r
-\r
     private void requestForDownload() {\r
         Account account = AccountUtils.getCurrentOwnCloudAccount(this);\r
         if (!mDownloaderBinder.isDownloading(account, mWaitingToPreview)) {\r