Browse Source

Fixed audio preview loop got when a tablet is torned to portrait orientation while audio preview is playing in landscape, and then the preview is left with BACK

David A. Velasco 12 years ago
parent
commit
a0e4e7ea97

+ 14 - 1
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -211,6 +211,19 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
         mDualPane = (findViewById(R.id.file_details_container) != null);
         if (mDualPane) {
             initFileDetailsInDualPane();
+        } else {
+            // quick patchES to fix problem in turn from landscape to portrait, when a file is selected in the right pane
+            // TODO serious refactorization in activities and fragments providing file browsing and handling 
+            if (mCurrentFile != null) {
+                onFileClick(mCurrentFile);
+                mCurrentFile = null;
+            }
+            Fragment rightPanel = getSupportFragmentManager().findFragmentByTag(FileDetailFragment.FTAG);
+            if (rightPanel != null) {
+                FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+                transaction.remove(rightPanel);
+                transaction.commit();
+            }
         }
             
         // Action bar setup
@@ -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;
     }
 
-
+    
     /**
      *  Load of state dependent of the existence of an ownCloud account
      */

+ 1 - 1
src/com/owncloud/android/ui/fragment/FileDetailFragment.java

@@ -303,7 +303,7 @@ public class FileDetailFragment extends SherlockFragment implements
         }
         leaveTransferProgress();
     }
-    
+
     
     @Override
     public View getView() {