mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Fixed text preview filter to take into account local knowledge about MIME types
This commit is contained in:
parent
68ce6e62bf
commit
3f40da0ac9
1 changed files with 5 additions and 1 deletions
|
@ -393,12 +393,16 @@ public class PreviewTextFragment extends FileFragment {
|
|||
public static boolean canBePreviewed(OCFile file) {
|
||||
final List<String> unsupportedTypes = new LinkedList<String>();
|
||||
unsupportedTypes.add("text/richtext");
|
||||
unsupportedTypes.add("text/rtf");
|
||||
unsupportedTypes.add("text/vnd.abc");
|
||||
unsupportedTypes.add("text/vnd.fmi.flexstor");
|
||||
unsupportedTypes.add("text/vnd.rn-realtext");
|
||||
unsupportedTypes.add("text/vnd.wap.wml");
|
||||
unsupportedTypes.add("text/vnd.wap.wmlscript");
|
||||
return (file != null && file.isDown() && file.isText() && !unsupportedTypes.contains(file.getMimetype()));
|
||||
return (file != null && file.isDown() && file.isText() &&
|
||||
!unsupportedTypes.contains(file.getMimetype()) &&
|
||||
!unsupportedTypes.contains(file.getMimeTypeFromName())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue