[Android] Refactor the UPDATE_FAVORITE_STATE payload outside of the audio adapter

Nicolas Pomepuy git at videolan.org
Tue Mar 14 11:59:19 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Feb 20 13:40:12 2023 +0100| [934ce121fa956af814f2ffb3b0a28cc4be15b591] | committer: Nicolas Pomepuy

Refactor the UPDATE_FAVORITE_STATE payload outside of the audio adapter

> https://code.videolan.org/videolan/vlc-android/commit/934ce121fa956af814f2ffb3b0a28cc4be15b591
---

 .../resources/src/main/java/org/videolan/resources/Constants.kt        | 1 +
 .../vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt  | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/resources/src/main/java/org/videolan/resources/Constants.kt b/application/resources/src/main/java/org/videolan/resources/Constants.kt
index 1d82d5c127..8aafa0d7e0 100644
--- a/application/resources/src/main/java/org/videolan/resources/Constants.kt
+++ b/application/resources/src/main/java/org/videolan/resources/Constants.kt
@@ -185,6 +185,7 @@ const val UPDATE_DESCRIPTION = 4
 const val UPDATE_PAYLOAD = 5
 const val UPDATE_VIDEO_GROUP = 6
 const val UPDATE_REORDER = 7
+const val UPDATE_FAVORITE_STATE = 8
 
 const val KEY_URI = "uri"
 const val SELECTED_ITEM = "selected"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
index 7a050f77b4..4312254dc1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.kt
@@ -43,13 +43,13 @@ import androidx.paging.PagedListAdapter
 import androidx.recyclerview.widget.DiffUtil
 import androidx.recyclerview.widget.RecyclerView
 import org.videolan.libvlc.util.AndroidUtil
-import org.videolan.medialibrary.interfaces.media.Album
 import org.videolan.medialibrary.interfaces.media.Artist
 import org.videolan.medialibrary.interfaces.media.Genre
 import org.videolan.medialibrary.interfaces.media.MediaWrapper
 import org.videolan.medialibrary.media.MediaLibraryItem
 import org.videolan.medialibrary.media.MediaLibraryItem.FLAG_SELECTED
 import org.videolan.resources.AppContextProvider
+import org.videolan.resources.UPDATE_FAVORITE_STATE
 import org.videolan.resources.UPDATE_REORDER
 import org.videolan.resources.UPDATE_SELECTION
 import org.videolan.resources.interfaces.FocusListener
@@ -367,7 +367,6 @@ open class AudioBrowserAdapter @JvmOverloads constructor(
 
         private const val TAG = "VLC/AudioBrowserAdapter"
         private const val UPDATE_PAYLOAD = 1
-        private const val UPDATE_FAVORITE_STATE = 2
         /**
          * Awful hack to workaround the [PagedListAdapter] not keeping track of notifyItemMoved operations
          */



More information about the Android mailing list