[Android] Fix playlist default drawable scale type
Nicolas Pomepuy
git at videolan.org
Wed Feb 14 06:23:47 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Feb 13 15:21:58 2024 +0100| [6a9f9859d17f3e17b6b61d32d740a3c34ba07b23] | committer: Nicolas Pomepuy
Fix playlist default drawable scale type
> https://code.videolan.org/videolan/vlc-android/commit/6a9f9859d17f3e17b6b61d32d740a3c34ba07b23
---
.../vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
index c97d1ffc38..f5a17ca85a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
@@ -286,7 +286,7 @@ private suspend fun getPlaylistOrGenreImage(v: View, item: MediaLibraryItem, bin
if (!bindChanged && playlistImage == null) playlistImage = defaultDrawable
if (!bindChanged && playlistImage == null) binding?.setVariable(BR.showProgress, false)
- if (!bindChanged) updateImageView(playlistImage, v, binding)
+ if (!bindChanged) updateImageView(playlistImage, v, binding, card = card)
binding?.removeOnRebindCallback(rebindCallbacks!!)
}
@@ -310,7 +310,7 @@ fun updateImageViewTv(@DrawableRes res: Int, target: View) {
fun updateImageView(bitmap: Bitmap?, target: View, vdb: ViewDataBinding?, updateScaleType: Boolean = true, tv: Boolean = false, card: Boolean = false) {
if (bitmap === null || bitmap.width <= 1 || bitmap.height <= 1) return
if (vdb !== null && !tv) {
- vdb.setVariable(BR.scaleType, if (card) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER)
+ vdb.setVariable(BR.scaleType, if (card) ImageView.ScaleType.CENTER_INSIDE else ImageView.ScaleType.FIT_CENTER)
vdb.setVariable(BR.cover, BitmapDrawable(target.resources, bitmap))
vdb.setVariable(BR.protocol, null)
vdb.setVariable(BR.showProgress, false)
More information about the Android
mailing list