From 6caad2be05fcb5255018616ef5fbe053570b4956 Mon Sep 17 00:00:00 2001 From: jabarros Date: Tue, 30 Dec 2014 11:55:13 +0100 Subject: [PATCH] Fixed. Icons which have extensions in UpperCase, in the uploads view are not correct --- src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java | 2 +- src/com/owncloud/android/utils/BitmapUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java b/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java index 73f81cf91b..847619703b 100644 --- a/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/LocalFileListAdapter.java @@ -160,7 +160,7 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter { } } else { Uri selectedUri = Uri.fromFile(file); - String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString()); + String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString().toLowerCase()); String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension); fileIcon.setImageResource(DisplayUtils.getResourceId(mimeType, file.getName())); } diff --git a/src/com/owncloud/android/utils/BitmapUtils.java b/src/com/owncloud/android/utils/BitmapUtils.java index df04a41088..92824f44c6 100644 --- a/src/com/owncloud/android/utils/BitmapUtils.java +++ b/src/com/owncloud/android/utils/BitmapUtils.java @@ -181,7 +181,7 @@ public class BitmapUtils { */ public static boolean isImage(File file) { Uri selectedUri = Uri.fromFile(file); - String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString()); + String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString().toLowerCase()); String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension); return (mimeType != null && mimeType.startsWith("image/"));