Fixed audio preview loop got when a tablet is torned to portrait orientation while...
authorDavid A. Velasco <dvelasco@solidgear.es>
Thu, 28 Feb 2013 12:26:43 +0000 (13:26 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Thu, 28 Feb 2013 12:26:43 +0000 (13:26 +0100)
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
src/com/owncloud/android/ui/fragment/FileDetailFragment.java

index 2be4e75..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
         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
         }\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
         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
     /**\r
      *  Load of state dependent of the existence of an ownCloud account\r
      */\r
index 7eb6cda..0ee824d 100644 (file)
@@ -303,7 +303,7 @@ public class FileDetailFragment extends SherlockFragment implements
         }\r
         leaveTransferProgress();\r
     }\r
         }\r
         leaveTransferProgress();\r
     }\r
-    \r
+\r
     \r
     @Override\r
     public View getView() {\r
     \r
     @Override\r
     public View getView() {\r