Fixed a bug that would cause the details view to be shown upon turning off and on...
authorJorge Antonio Diaz-Benito Soriano <jorge.diazbenitosoriano@gmail.com>
Sun, 26 Oct 2014 14:38:57 +0000 (15:38 +0100)
committerJorge Antonio Diaz-Benito Soriano <jorge.diazbenitosoriano@gmail.com>
Tue, 28 Oct 2014 18:11:31 +0000 (19:11 +0100)
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index 58b3996..627d40c 100644 (file)
@@ -304,6 +304,8 @@ public class FileDisplayActivity extends HookActivity implements
 
             } else {
                 cleanSecondFragment();
 
             } else {
                 cleanSecondFragment();
+                if (file.isDown() && PreviewTextFragment.canBePreviewed(file))
+                    startTextPreview(file);
             }
 
         } else {
             }
 
         } 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);
 
                 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;
     }
         }
         return secondFragment;
     }