From: David A. Velasco Date: Thu, 28 Feb 2013 12:26:43 +0000 (+0100) Subject: Fixed audio preview loop got when a tablet is torned to portrait orientation while... X-Git-Tag: oc-android-1.4.3~39^2~29 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/a0e4e7ea97d5686b29a4e778fcab688f8c4f1bc8?ds=inline 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 --- diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 2be4e750..97660e7d 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/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 */ diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 7eb6cda6..0ee824d2 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -303,7 +303,7 @@ public class FileDetailFragment extends SherlockFragment implements } leaveTransferProgress(); } - + @Override public View getView() {