From: Jorge Antonio Diaz-Benito Soriano Date: Sun, 26 Oct 2014 14:38:57 +0000 (+0100) Subject: Fixed a bug that would cause the details view to be shown upon turning off and on... X-Git-Tag: oc-android-1.8~17^2~8^2~15 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/b1ef5d94d4c430be3bf7839eff0e7b37a03ed2b7?ds=inline;hp=--cc Fixed a bug that would cause the details view to be shown upon turning off and on the screen --- b1ef5d94d4c430be3bf7839eff0e7b37a03ed2b7 diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 58b39967..627d40cf 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -304,6 +304,8 @@ public class FileDisplayActivity extends HookActivity implements } else { cleanSecondFragment(); + if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) + startTextPreview(file); } } else { @@ -327,9 +329,9 @@ public class FileDisplayActivity extends HookActivity implements boolean autoplay = getIntent().getBooleanExtra(PreviewVideoActivity.EXTRA_AUTOPLAY, true); secondFragment = new PreviewMediaFragment(file, getAccount(), startPlaybackPosition, autoplay); - } else { - secondFragment = new FileDetailFragment(file, getAccount()); - } + } else if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) { + secondFragment = null; + } else secondFragment = new FileDetailFragment(file, getAccount()); } return secondFragment; }