uset the proper file icon at creating a shortcut

This commit is contained in:
tibbi 2020-06-19 21:20:26 +02:00
parent 6b6a4acb58
commit 1fcc63ebea

View File

@ -290,7 +290,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
drawable.findDrawableByLayerId(R.id.shortcut_folder_background).applyColorFilter(0)
drawable.setDrawableByLayerId(R.id.shortcut_folder_image, bitmap)
} catch (e: Exception) {
val fileIcon = activity.resources.getDrawable(R.drawable.ic_file_generic)
val fileIcon = fileDrawables.getOrElse(path.substringAfterLast(".").toLowerCase(), { fileDrawable })
drawable.setDrawableByLayerId(R.id.shortcut_folder_image, fileIcon)
}