diff --git a/app/src/main/java/com/nextcloud/utils/extensions/DisplayMetricsExtensions.kt b/app/src/main/java/com/nextcloud/utils/extensions/DisplayMetricsExtensions.kt index e85541fe2f..4825a7fbce 100644 --- a/app/src/main/java/com/nextcloud/utils/extensions/DisplayMetricsExtensions.kt +++ b/app/src/main/java/com/nextcloud/utils/extensions/DisplayMetricsExtensions.kt @@ -4,4 +4,4 @@ import android.util.DisplayMetrics fun DisplayMetrics.isLowDensityScreen(): Boolean { return this.density < 2 -} \ No newline at end of file +} diff --git a/app/src/main/java/com/nextcloud/utils/extensions/LayerDrawableExtensions.kt b/app/src/main/java/com/nextcloud/utils/extensions/LayerDrawableExtensions.kt index 3c1dc0b5b7..fe9e2fe4c9 100644 --- a/app/src/main/java/com/nextcloud/utils/extensions/LayerDrawableExtensions.kt +++ b/app/src/main/java/com/nextcloud/utils/extensions/LayerDrawableExtensions.kt @@ -7,4 +7,4 @@ fun LayerDrawable.setLayerSizeWithInsetTop(index: Int, size: Int, margin: Int) { setLayerSize(index, size, size) setLayerInsetTop(index, margin) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/GroupfolderListAdapter.kt b/app/src/main/java/com/owncloud/android/ui/adapter/GroupfolderListAdapter.kt index 6584060c8f..9a3f453ccc 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/GroupfolderListAdapter.kt +++ b/app/src/main/java/com/owncloud/android/ui/adapter/GroupfolderListAdapter.kt @@ -51,10 +51,8 @@ class GroupfolderListAdapter( } private fun getFolderIcon(): LayerDrawable? { - val folderDrawable = MimeTypeUtil.getDefaultFolderIcon(context, viewThemeUtils) ?: return null - val overlayDrawable = ContextCompat.getDrawable(context, R.drawable.ic_folder_overlay_account_group) ?: return null - val drawableUtil = DrawableUtil() - return drawableUtil.addDrawableAsOverlay(context, folderDrawable, overlayDrawable) + val overlayDrawableId = R.drawable.ic_folder_overlay_account_group + return MimeTypeUtil.getFileIcon(false, overlayDrawableId, context, viewThemeUtils) } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { diff --git a/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt b/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt index 286089dc35..80732d9028 100644 --- a/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt +++ b/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt @@ -19,8 +19,11 @@ class DrawableUtil { fun addDrawableAsOverlay(context: Context, backgroundDrawable: Drawable, overlayDrawable: Drawable): LayerDrawable { val isLowDensityScreen = context.resources.displayMetrics.isLowDensityScreen() - val overlayIconSize = if (isLowDensityScreen) { 12 } else { 24 } - val overlayIconTopMargin = if (isLowDensityScreen) { 3 } else { 6 } + val defaultIconSize = 24 + val defaultIconTopMargin = 6 + + val overlayIconSize = if (isLowDensityScreen) { defaultIconSize / 2 } else { defaultIconSize } + val overlayIconTopMargin = if (isLowDensityScreen) { defaultIconTopMargin / 2 } else { defaultIconTopMargin } val layerDrawable = LayerDrawable(arrayOf(backgroundDrawable, overlayDrawable)) layerDrawable.setLayerSizeWithInsetTop(1, overlayIconSize, overlayIconTopMargin) @@ -28,4 +31,4 @@ class DrawableUtil { return layerDrawable } -} \ No newline at end of file +}