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~14^2 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/46ff60a9e760a760b478609bac68d45f8728488f?ds=inline;hp=-c Fixed a bug that would cause the details view to be shown upon turning off and on the screen --- 46ff60a9e760a760b478609bac68d45f8728488f diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 60636df4..1bf8365a 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -303,6 +303,8 @@ public class FileDisplayActivity extends HookActivity implements } else { cleanSecondFragment(); + if (file.isDown() && PreviewTextFragment.canBePreviewed(file)) + startTextPreview(file); } } else { @@ -326,9 +328,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; }