[Android] History: network icon display when network scheme

Duncan McNamara git at videolan.org
Wed Apr 27 11:22:45 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Apr 20 18:00:35 2022 +0200| [3ebd77699b573fc49f8c390be118345f6637f473] | committer: Nicolas Pomepuy

History: network icon display when network scheme

Now that the network icon is used for network files and not external
files, it should use isSchemeNetwork to be displayed and not
!isSchemeFile.

> https://code.videolan.org/videolan/vlc-android/commit/3ebd77699b573fc49f8c390be118345f6637f473
---

 application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
index 674cb882d..031efdab8 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.kt
@@ -42,7 +42,8 @@ import org.videolan.vlc.interfaces.IListEventsHandler
 import org.videolan.vlc.interfaces.SwipeDragHelperAdapter
 import org.videolan.vlc.util.isOTG
 import org.videolan.vlc.util.isSD
-import org.videolan.vlc.util.isSchemeFile
+import org.videolan.vlc.util.isSchemeNetwork
+
 
 class HistoryAdapter(private val inCards: Boolean = false, private val listEventsHandler: IListEventsHandler? = null) : DiffUtilAdapter<MediaWrapper, HistoryAdapter.ViewHolder>(),
         MultiSelectAdapter<MediaWrapper>, IEventsSource<Click> by EventsSource(), SwipeDragHelperAdapter {
@@ -112,7 +113,7 @@ class HistoryAdapter(private val inCards: Boolean = false, private val listEvent
         when (holder.binding) {
             is HistoryItemBinding -> {
                 (holder.binding as HistoryItemBinding).media = media
-                holder.binding.setVariable(BR.isNetwork, !media.uri.scheme.isSchemeFile())
+                holder.binding.setVariable(BR.isNetwork, media.uri.scheme.isSchemeNetwork())
                 holder.binding.setVariable(BR.isSD, media.uri.isSD())
                 holder.binding.setVariable(BR.isOTG, media.uri.isOTG())
                 (holder.binding as HistoryItemBinding).cover = getMediaIconDrawable(holder.itemView.context, media.type)
@@ -120,7 +121,7 @@ class HistoryAdapter(private val inCards: Boolean = false, private val listEvent
             }
             is HistoryItemCardBinding -> {
                 (holder.binding as HistoryItemCardBinding).media = media
-                holder.binding.setVariable(BR.isNetwork, !media.uri.scheme.isSchemeFile())
+                holder.binding.setVariable(BR.isNetwork, media.uri.scheme.isSchemeNetwork())
                 holder.binding.setVariable(BR.isSD, media.uri.isSD())
                 holder.binding.setVariable(BR.isOTG, media.uri.isOTG())
                 (holder.binding as HistoryItemCardBinding).cover = getMediaIconDrawable(holder.itemView.context, media.type)



More information about the Android mailing list