From a0e4e7ea97d5686b29a4e778fcab688f8c4f1bc8 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Thu, 28 Feb 2013 13:26:43 +0100 Subject: [PATCH] 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 --- .../owncloud/android/ui/activity/FileDisplayActivity.java | 15 ++++++++++++++- .../owncloud/android/ui/fragment/FileDetailFragment.java | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) 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() { -- 2.11.0