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>
Sun, 26 Oct 2014 14:38:57 +0000 (15:38 +0100)
src/com/owncloud/android/ui/activity/FileDisplayActivity.java

index 60636df..1bf8365 100644 (file)
@@ -303,6 +303,8 @@ public class FileDisplayActivity extends HookActivity implements
 
             } else {
                 cleanSecondFragment();
 
             } else {
                 cleanSecondFragment();
+                if (file.isDown() && PreviewTextFragment.canBePreviewed(file))
+                    startTextPreview(file);
             }
 
         } else {
             }
 
         } 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);
 
                 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;
     }