[Android] Remove unnecessary loadImage custom binding

Geoffrey Métais git at videolan.org
Tue Feb 26 09:56:11 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 25 16:25:20 2019 +0100| [067ecf4842b5db4bf063e39f89dbe8987ab2f128] | committer: Geoffrey Métais

Remove unnecessary loadImage custom binding

> https://code.videolan.org/videolan/vlc-android/commit/067ecf4842b5db4bf063e39f89dbe8987ab2f128
---

 vlc-android/res/layout/audio_browser_item.xml             |  1 -
 .../src/org/videolan/vlc/gui/helpers/ImageLoader.kt       | 15 ---------------
 2 files changed, 16 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser_item.xml b/vlc-android/res/layout/audio_browser_item.xml
index 50fb3d8ac..6c7b85a21 100644
--- a/vlc-android/res/layout/audio_browser_item.xml
+++ b/vlc-android/res/layout/audio_browser_item.xml
@@ -58,7 +58,6 @@
             android:layout_marginTop="8dp"
             android:layout_marginBottom="8dp"
             android:background="@{cover}"
-            vlc:itemType="@{type}"
             vlc:layout_constraintBottom_toBottomOf="parent"
             vlc:layout_constraintDimensionRatio="1"
             vlc:layout_constraintStart_toStartOf="parent"
diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
index 65ba61329..30e8d2882 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/ImageLoader.kt
@@ -53,21 +53,6 @@ fun loadImage(v: View, item: MediaLibraryItem?) {
     else AppScope.launch { getImage(v, findInLibrary(item, isMedia, isGroup), binding) }
 }
 
-
- at MainThread
- at BindingAdapter("binding:media", "binding:itemType")
-fun loadImage(v: View, media: MediaLibraryItem?, itemType: Int) {
-    val binding = DataBindingUtil.findBinding<ViewDataBinding>(v)
-
-    if (media === null) {
-//        updateImageView(getIconDrawable(itemType)?.bitmap, v, binding)
-        updateImageView(BitmapDrawable(BitmapCache.getFromResource(VLCApplication.getAppResources(), R.drawable.rounded_corners_grey)).bitmap, v, binding)
-        return
-    }
-
-    loadImage(v, media)
-}
-
 fun getIconDrawable(type: Int): BitmapDrawable? {
     return when (type) {
         MediaLibraryItem.TYPE_ALBUM -> UiTools.Resources.DEFAULT_COVER_ALBUM_DRAWABLE



More information about the Android mailing list