} else {
cleanSecondFragment();
+ if (file.isDown() && PreviewTextFragment.canBePreviewed(file))
+ startTextPreview(file);
}
} else {
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;
}
if (details instanceof PreviewMediaFragment) {
// Refresh OCFile of the fragment
((PreviewMediaFragment) details).updateFile(file);
- } else {
+ } else if (details instanceof PreviewTextFragment) {
+ // Refresh OCFile of the fragment
+ ((PreviewTextFragment) details).updateFile(file);
+ } else
showDetails(file);
- }
}
invalidateOptionsMenu();
}