mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 13:15:35 +03:00
commit
4c0e1c0761
5 changed files with 100 additions and 6 deletions
1
drawable_resources/link.svg
Normal file
1
drawable_resources/link.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 16 16" width="16" version="1.1" height="16"><path fill="#969696" d="m7.95 0.65c-4.1 0-7.4 3.3-7.4 7.4s3.3 7.4 7.4 7.4 7.4-3.3 7.4-7.4-3.3-7.4-7.4-7.4zm0.8 0.9c1.3 0 2.4 0.8 3.5 1.3l1.8 2.5-0.3 1.1 0.6 0.3v2.4c-0.2 0.7-0.6 1.3-0.9 2-0.2 0.1 0-0.8-0.1-1 0-0.6-0.5-0.6-0.9-0.2-0.4 0.3-1.4 0.3-1.5-0.4-0.3-0.8 0-1.7 0.3-2.5l-0.6-0.7 0.2-1.8-0.8-0.9 0.2-1-1-0.6c-0.2-0.2-0.6-0.2-0.7-0.4 0.1 0 0.2-0.1 0.2-0.1zm-2.6 0.1s0.1 0 0.1 0.1c0.4 0.2-0.1 0.4-0.2 0.6-0.5 0.3 0.3 0.7 0.5 1 0.4-0.1 0.8-0.7 1.4-0.5 0.7-0.2 0.6 0.6 1.1 1 0.1 0.2 0.9 0.8 0.4 0.6-0.5-0.4-1-0.4-1.3 0.1-0.8 0.5-0.3-0.9-0.7-1.2-0.6-0.7-0.4 0.5-0.4 0.9-0.4 0-1.1-0.3-1.5 0.2l0.4 0.6 0.5-0.7c0-0.3 0.1 0.2 0.3 0.3 0.1 0.2 0.8 0.7 0.3 0.9-0.8 0.4-1.4 1.1-2.1 1.7-0.2 0.5-0.7 0.4-1 0-0.7-0.4-0.7 0.7-0.6 1.1l0.6-0.4v1.1c-0.4 0.4-0.9-0.7-1.3-0.9v-1.6c0-0.4-0.1-0.9 0-1.3 0.8-0.9 1.7-1.9 2.2-3h0.8c0.6 0.2 0.3-0.7 0.5-0.6zm-1.2 8.2c0.1 0 0.2 0 0.3 0.1 0.8 0.1 1.4 0.7 2 1.1 0.5 0.5 1.6 0.3 1.7 1.2-0.2 0.9-1.1 1.4-1.8 1.7-0.2 0.1-0.4 0.2-0.6 0.2-0.7 0.2-1-0.6-1.2-1.1-0.3-0.7-1.1-1.2-1-2.1 0-0.4 0.2-1 0.6-1.1z"/></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
drawable_resources/location.svg
Normal file
1
drawable_resources/location.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" version="1.1" height="16"><circle stroke-width="2" stroke="#969696" cy="6" cx="8" r="4" fill="none"/><path fill="#969696" d="m4 9h8l-4 6z"/></svg>
|
After Width: | Height: | Size: 218 B |
|
@ -192,7 +192,10 @@ public final class MimeTypeUtil {
|
|||
* @return A single MIME type, "application/octet-stream" for unknown file extensions.
|
||||
*/
|
||||
public static String getBestMimeTypeByFilename(String filename) {
|
||||
List<String> candidates = determineMimeTypesByFilename(filename);
|
||||
return getMimeTypeFromCandidates(determineMimeTypesByFilename(filename));
|
||||
}
|
||||
|
||||
private static String getMimeTypeFromCandidates(List<String> candidates) {
|
||||
if (candidates == null || candidates.size() < 1) {
|
||||
return "application/octet-stream";
|
||||
}
|
||||
|
@ -372,15 +375,23 @@ public final class MimeTypeUtil {
|
|||
* @return list of possible mime types (ordered), empty list in case no mime types found
|
||||
*/
|
||||
private static List<String> determineMimeTypesByFilename(String filename) {
|
||||
String fileExtension = getExtension(filename);
|
||||
return determineMimeTypesByExtension(getExtension(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* determines the list of possible mime types for the given file, based on its extension.
|
||||
*
|
||||
* @param extension the file extension
|
||||
* @return list of possible mime types (ordered), empty list in case no mime types found
|
||||
*/
|
||||
private static List<String> determineMimeTypesByExtension(String extension) {
|
||||
// try detecting the mimetype based on the web app logic equivalent
|
||||
List<String> mimeTypeList = FILE_EXTENSION_TO_MIMETYPE_MAPPING.get(fileExtension);
|
||||
List<String> mimeTypeList = FILE_EXTENSION_TO_MIMETYPE_MAPPING.get(extension);
|
||||
if (mimeTypeList != null && mimeTypeList.size() > 0) {
|
||||
return mimeTypeList;
|
||||
} else {
|
||||
// try detecting the mime type via android itself
|
||||
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
|
||||
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
|
||||
if (mimeType != null) {
|
||||
return Collections.singletonList(mimeType);
|
||||
} else {
|
||||
|
@ -393,9 +404,17 @@ public final class MimeTypeUtil {
|
|||
String extension = "";
|
||||
int pos = path.lastIndexOf('.');
|
||||
if (pos >= 0) {
|
||||
extension = path.substring(pos + 1);
|
||||
extension = path.substring(pos + 1).toLowerCase(Locale.ROOT);
|
||||
}
|
||||
String result = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase(Locale.ROOT));
|
||||
|
||||
// Ask OS for mimetype
|
||||
String result = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
|
||||
|
||||
// fallback to Nc mimetype mapping
|
||||
if (result == null) {
|
||||
result = getMimeTypeFromCandidates(determineMimeTypesByExtension(extension));
|
||||
}
|
||||
|
||||
return (result != null) ? result : "";
|
||||
}
|
||||
|
||||
|
@ -417,11 +436,15 @@ public final class MimeTypeUtil {
|
|||
MIMETYPE_TO_ICON_MAPPING.put("application/epub+zip", R.drawable.file_text);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/font-sfnt", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/font-woff", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/gpx+xml", R.drawable.file_location);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/illustrator", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/internet-shortcut", R.drawable.file_link);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/java", R.drawable.file_application);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/javascript", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/json", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/msaccess", R.drawable.file);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/msexcel", R.drawable.file_xls);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/msonenote", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/mspowerpoint", R.drawable.file_ppt);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/msword", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/octet-stream", R.drawable.file);
|
||||
|
@ -430,6 +453,10 @@ public final class MimeTypeUtil {
|
|||
MIMETYPE_TO_ICON_MAPPING.put("application/rss+xml", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/rtf", R.drawable.file);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.android.package-archive", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.garmin.tcx+xml", R.drawable.file_location);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.google-earth.kml+xml", R.drawable.file_location);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.google-earth.kmz", R.drawable.file_location);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.lotus-wordpro", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel", R.drawable.file_xls);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.addin.macroEnabled.12", R.drawable.file_xls);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-excel.sheet.binary.macroEnabled.12", R.drawable.file_xls);
|
||||
|
@ -441,6 +468,12 @@ public final class MimeTypeUtil {
|
|||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.presentation.macroEnabled.12", R.drawable.file_ppt);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.slideshow.macroEnabled.12", R.drawable.file_ppt);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-powerpoint.template.macroEnabled.12", R.drawable.file_ppt);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.drawing.macroEnabled.12", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.drawing", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.stencil.macroEnabled.12", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.stencil", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.template.macroEnabled.12", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-visio.template", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-word.document.macroEnabled.12", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.ms-word.template.macroEnabled.12", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.presentation", R.drawable.file_ppt);
|
||||
|
@ -458,16 +491,23 @@ public final class MimeTypeUtil {
|
|||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.spreadsheetml.template", R.drawable.file_xls);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.wordprocessingml.document", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.wordprocessingml.template", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.visio", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/vnd.wordperfect", R.drawable.file_doc);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-7z-compressed", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-bin", R.drawable.file_application);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-bzip2", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-cbr", R.drawable.file_text);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-compressed", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-dcraw", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-deb", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-fictionbook+xml", R.drawable.file_text);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-font", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-gimp", R.drawable.file_image);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-gzip", R.drawable.file_zip);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-love-game", R.drawable.file);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-mobipocket-ebook", R.drawable.file_text);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-ms-dos-executable", R.drawable.file_application);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-msdos-program", R.drawable.file_application);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-msi", R.drawable.file_application);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-iwork-numbers-sffnumbers", R.drawable.file_xls);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("application/x-iwork-keynote-sffkey", R.drawable.file_ppt);
|
||||
|
@ -494,6 +534,8 @@ public final class MimeTypeUtil {
|
|||
MIMETYPE_TO_ICON_MAPPING.put("text/x-c", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-c++src", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-h", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-java-source", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-ldif", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-python", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("text/x-shellscript", R.drawable.file_code);
|
||||
MIMETYPE_TO_ICON_MAPPING.put("web", R.drawable.file_code);
|
||||
|
@ -525,10 +567,12 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("arw", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("avi", Collections.singletonList("video/x-msvideo"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bash", Collections.singletonList("text/x-shellscript"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bat", Collections.singletonList("application/x-msdos-program"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("blend", Collections.singletonList("application/x-blender"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bin", Collections.singletonList("application/x-bin"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bmp", Collections.singletonList("image/bmp"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bpg", Collections.singletonList("image/bpg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("bz2", Collections.singletonList("application/x-bzip2"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cb7", Collections.singletonList("application/x-cbr"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cba", Collections.singletonList("application/x-cbr"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbr", Collections.singletonList("application/x-cbr"));
|
||||
|
@ -537,6 +581,7 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cbz", Collections.singletonList("application/x-cbr"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cc", Collections.singletonList("text/x-c"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cdr", Collections.singletonList("application/coreldraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("class", Collections.singletonList("application/java"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cnf", Collections.singletonList("text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("conf", Collections.singletonList("text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("cpp", Collections.singletonList("text/x-c++src"));
|
||||
|
@ -560,19 +605,27 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("eps", Collections.singletonList("application/postscript"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("erf", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("exe", Collections.singletonList("application/x-ms-dos-executable"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("fb2", Arrays.asList("application/x-fictionbook+xml", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("flac", Collections.singletonList("audio/flac"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("flv", Collections.singletonList("video/x-flv"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gif", Collections.singletonList("image/gif"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gpx", Collections.singletonList("application/gpx+xml"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gz", Collections.singletonList("application/gzip"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("gzip", Collections.singletonList("application/gzip"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("h", Collections.singletonList("text/x-h"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("heic", Collections.singletonList("image/heic"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("heif", Collections.singletonList("image/heif"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("hh", Collections.singletonList("text/x-h"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("hpp", Collections.singletonList("text/x-h"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("htaccess", Collections.singletonList("text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("html", Arrays.asList("text/html", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("htm", Arrays.asList("text/html", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ical", Collections.singletonList("text/calendar"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ics", Collections.singletonList("text/calendar"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("iiq", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("impress", Collections.singletonList("text/impress"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("java", Collections.singletonList("text/x-java-source"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jp2", Collections.singletonList("image/jp2"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jpeg", Collections.singletonList("image/jpeg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jpg", Collections.singletonList("image/jpeg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("jps", Collections.singletonList("image/jpeg"));
|
||||
|
@ -582,8 +635,18 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kdc", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("key", Collections.singletonList("application/x-iwork-keynote-sffkey"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("keynote", Collections.singletonList("application/x-iwork-keynote-sffkey"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kml", Collections.singletonList("application/vnd.google-earth.kml+xml"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kmz", Collections.singletonList("application/vnd.google-earth.kmz"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("kra", Collections.singletonList("application/x-krita"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ldif", Collections.singletonList("text/x-ldif"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("love", Collections.singletonList("application/x-love-game"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("lwp", Collections.singletonList("application/vnd.lotus-wordpro"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m", Arrays.asList("text/x-matlab", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m2t", Collections.singletonList("video/mp2t"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m3u", Collections.singletonList("audio/mpegurl"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m3u8", Collections.singletonList("audio/mpegurl"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m4a", Collections.singletonList("audio/mp4"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m4b", Collections.singletonList("audio/m4b"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("m4v", Collections.singletonList("video/mp4"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("markdown", Collections.singletonList("text/markdown"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("mdown", Collections.singletonList("text/markdown"));
|
||||
|
@ -613,6 +676,7 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("oga", Collections.singletonList("audio/ogg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ogg", Collections.singletonList("audio/ogg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("ogv", Collections.singletonList("video/ogg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("one", Collections.singletonList("application/msonenote"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("opus", Collections.singletonList("audio/ogg"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("orf", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("otf", Collections.singletonList("application/font-sfnt"));
|
||||
|
@ -622,6 +686,7 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pef", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("php", Collections.singletonList("application/x-php"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pl", Collections.singletonList("application/x-perl"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pls", Collections.singletonList("audio/x-scpls"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("png", Collections.singletonList("image/png"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("pot", Collections.singletonList("application/vnd.ms-powerpoint"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("potm", Collections.singletonList("application/vnd.ms-powerpoint.template.macroEnabled.12"));
|
||||
|
@ -640,8 +705,10 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("raf", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rar", Collections.singletonList("application/x-rar-compressed"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("reveal", Collections.singletonList("text/reveal"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rss", Collections.singletonList("application/rss+xml"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rtf", Collections.singletonList("application/rtf"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("rw2", Collections.singletonList("image/x-dcraw"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("schema", Collections.singletonList("text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sgf", Collections.singletonList("application/sgf"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sh-lib", Collections.singletonList("text/x-shellscript"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("sh", Collections.singletonList("text/x-shellscript"));
|
||||
|
@ -650,6 +717,10 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("svg", Arrays.asList("image/svg+xml", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("swf", Arrays.asList("application/x-shockwave-flash", "application/octet-stream"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tar", Collections.singletonList("application/x-tar"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tar.bz2", Collections.singletonList("application/x-bzip2"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tar.gz", Collections.singletonList("application/x-compressed"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tbz2", Collections.singletonList("application/x-bzip2"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tcx", Collections.singletonList("application/vnd.garmin.tcx+xml"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tex", Collections.singletonList("application/x-tex"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tgz", Collections.singletonList("application/x-compressed"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("tiff", Collections.singletonList("image/tiff"));
|
||||
|
@ -659,9 +730,17 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vcard", Collections.singletonList("text/vcard"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vcf", Collections.singletonList("text/vcard"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vob", Collections.singletonList("video/dvd"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vsd", Collections.singletonList("application/vnd.visio"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vsdm", Collections.singletonList("application/vnd.ms-visio.drawing.macroEnabled.12"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vsdx", Collections.singletonList("application/vnd.ms-visio.drawing"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vssm", Collections.singletonList("application/vnd.ms-visio.stencil.macroEnabled.12"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vssx", Collections.singletonList("application/vnd.ms-visio.stencil"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vstm", Collections.singletonList("application/vnd.ms-visio.template.macroEnabled.12"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("vstx", Collections.singletonList("application/vnd.ms-visio.template"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("wav", Collections.singletonList("audio/wav"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("webm", Collections.singletonList("video/webm"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("woff", Collections.singletonList("application/font-woff"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("wpd", Collections.singletonList("application/vnd.wordperfect"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("wmv", Collections.singletonList("video/x-ms-wmv"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xcf", Collections.singletonList("application/x-gimp"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("xla", Collections.singletonList("application/vnd.ms-excel"));
|
||||
|
@ -678,5 +757,7 @@ public final class MimeTypeUtil {
|
|||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("yaml", Arrays.asList("application/yaml", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("yml", Arrays.asList("application/yaml", "text/plain"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("zip", Collections.singletonList("application/zip"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("url", Collections.singletonList("application/internet-shortcut"));
|
||||
FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("webloc", Collections.singletonList("application/internet-shortcut"));
|
||||
}
|
||||
}
|
||||
|
|
4
src/main/res/drawable/file_link.xml
Normal file
4
src/main/res/drawable/file_link.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<vector android:height="72dp" android:viewportHeight="16"
|
||||
android:viewportWidth="16" android:width="72dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#969696" android:pathData="m7.95,0.65c-4.1,0 -7.4,3.3 -7.4,7.4s3.3,7.4 7.4,7.4 7.4,-3.3 7.4,-7.4 -3.3,-7.4 -7.4,-7.4zM8.75,1.55c1.3,0 2.4,0.8 3.5,1.3l1.8,2.5 -0.3,1.1 0.6,0.3v2.4c-0.2,0.7 -0.6,1.3 -0.9,2 -0.2,0.1 0,-0.8 -0.1,-1 0,-0.6 -0.5,-0.6 -0.9,-0.2 -0.4,0.3 -1.4,0.3 -1.5,-0.4 -0.3,-0.8 0,-1.7 0.3,-2.5l-0.6,-0.7 0.2,-1.8 -0.8,-0.9 0.2,-1 -1,-0.6c-0.2,-0.2 -0.6,-0.2 -0.7,-0.4 0.1,0 0.2,-0.1 0.2,-0.1zM6.15,1.65s0.1,0 0.1,0.1c0.4,0.2 -0.1,0.4 -0.2,0.6 -0.5,0.3 0.3,0.7 0.5,1 0.4,-0.1 0.8,-0.7 1.4,-0.5 0.7,-0.2 0.6,0.6 1.1,1 0.1,0.2 0.9,0.8 0.4,0.6 -0.5,-0.4 -1,-0.4 -1.3,0.1 -0.8,0.5 -0.3,-0.9 -0.7,-1.2 -0.6,-0.7 -0.4,0.5 -0.4,0.9 -0.4,0 -1.1,-0.3 -1.5,0.2l0.4,0.6 0.5,-0.7c0,-0.3 0.1,0.2 0.3,0.3 0.1,0.2 0.8,0.7 0.3,0.9 -0.8,0.4 -1.4,1.1 -2.1,1.7 -0.2,0.5 -0.7,0.4 -1,0 -0.7,-0.4 -0.7,0.7 -0.6,1.1l0.6,-0.4v1.1c-0.4,0.4 -0.9,-0.7 -1.3,-0.9v-1.6c0,-0.4 -0.1,-0.9 0,-1.3 0.8,-0.9 1.7,-1.9 2.2,-3h0.8c0.6,0.2 0.3,-0.7 0.5,-0.6zM4.95,9.85c0.1,0 0.2,0 0.3,0.1 0.8,0.1 1.4,0.7 2,1.1 0.5,0.5 1.6,0.3 1.7,1.2 -0.2,0.9 -1.1,1.4 -1.8,1.7 -0.2,0.1 -0.4,0.2 -0.6,0.2 -0.7,0.2 -1,-0.6 -1.2,-1.1 -0.3,-0.7 -1.1,-1.2 -1,-2.1 0,-0.4 0.2,-1 0.6,-1.1z"/>
|
||||
</vector>
|
7
src/main/res/drawable/file_location.xml
Normal file
7
src/main/res/drawable/file_location.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<vector android:height="72dp" android:viewportHeight="16"
|
||||
android:viewportWidth="16" android:width="72dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#00000000"
|
||||
android:pathData="M8,6m-4,0a4,4 0,1 1,8 0a4,4 0,1 1,-8 0"
|
||||
android:strokeColor="#969696" android:strokeWidth="2"/>
|
||||
<path android:fillColor="#969696" android:pathData="m4,9h8l-4,6z"/>
|
||||
</vector>
|
Loading…
Reference in a new issue