[Android] Use list layout when displaying errors to prevent string truncation

Robert Stone git at videolan.org
Mon Jan 10 06:49:37 UTC 2022


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Sun Jan  9 11:40:47 2022 -0800| [d1a66634fb79af273c32a26894df6e3f68d299d0] | committer: Nicolas Pomepuy

Use list layout when displaying errors to prevent string truncation

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

 .../resources/src/main/java/org/videolan/resources/Constants.kt        | 1 +
 .../vlc-android/src/org/videolan/vlc/media/MediaSessionBrowser.kt      | 3 +++
 2 files changed, 4 insertions(+)

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 6d9468aef..4ee0aa6ed 100644
--- a/application/resources/src/main/java/org/videolan/resources/Constants.kt
+++ b/application/resources/src/main/java/org/videolan/resources/Constants.kt
@@ -70,6 +70,7 @@ const val CONTENT_STYLE_SUPPORTED = "android.media.browse.CONTENT_STYLE_SUPPORTE
 const val CONTENT_STYLE_PLAYABLE_HINT = "android.media.browse.CONTENT_STYLE_PLAYABLE_HINT"
 const val CONTENT_STYLE_BROWSABLE_HINT = "android.media.browse.CONTENT_STYLE_BROWSABLE_HINT"
 const val EXTRA_CONTENT_STYLE_GROUP_TITLE_HINT = "android.media.browse.CONTENT_STYLE_GROUP_TITLE_HINT"
+const val EXTRA_CONTENT_STYLE_SINGLE_ITEM = "android.media.browse.CONTENT_STYLE_SINGLE_ITEM_HINT"
 const val EXTRA_MEDIA_SEARCH_SUPPORTED = "android.media.browse.SEARCH_SUPPORTED"
 const val TABS_OPT_IN_HINT = "android.media.browse.AUTO_TABS_OPT_IN_HINT"
 const val CONTENT_STYLE_LIST_ITEM_HINT_VALUE = 1
diff --git a/application/vlc-android/src/org/videolan/vlc/media/MediaSessionBrowser.kt b/application/vlc-android/src/org/videolan/vlc/media/MediaSessionBrowser.kt
index f22f82c6d..7bc2b5c25 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/MediaSessionBrowser.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/MediaSessionBrowser.kt
@@ -463,6 +463,9 @@ class MediaSessionBrowser : ExtensionManagerActivity {
                         .setMediaId(ID_NO_MEDIA)
                         .setIconUri(DEFAULT_TRACK_ICON)
                         .setTitle(context.getString(R.string.search_no_result))
+                        .setExtras(Bundle().apply {
+                            putInt(EXTRA_CONTENT_STYLE_SINGLE_ITEM, CONTENT_STYLE_LIST_ITEM_HINT_VALUE)
+                        })
                 when (parentId) {
                     ID_ARTIST -> emptyMediaDesc.setIconUri(DEFAULT_ARTIST_ICON)
                     ID_ALBUM -> emptyMediaDesc.setIconUri(DEFAULT_ALBUM_ICON)



More information about the Android mailing list