[Android] Allow selection chapters for audio books

Nicolas Pomepuy git at videolan.org
Tue Sep 15 06:27:36 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Sep 14 09:36:20 2020 +0200| [511eeb7ec793e256b2517670ba13c76a3d082f54] | committer: Nicolas Pomepuy

Allow selection chapters for audio books

Fixes: #1454

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

 .../src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt         | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 0857f5c3f..f70bbfc06 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -111,10 +111,10 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
             if (primary)
                 options.add(PlayerOption(ID_REPEAT, R.drawable.ic_repeat, res.getString(R.string.repeat_title)))
             if (service.canShuffle()) options.add(PlayerOption(ID_SHUFFLE, R.drawable.ic_shuffle, res.getString(R.string.shuffle_title)))
-            val chaptersCount = service.getChapters(-1)?.size ?: 0
-            if (chaptersCount > 1) options.add(PlayerOption(ID_CHAPTER_TITLE, R.attr.ic_chapter_normal_style, res.getString(R.string.go_to_chapter)))
             options.add(PlayerOption(ID_VIDEO_STATS, R.attr.ic_video_stats, res.getString(R.string.video_information)))
         }
+        val chaptersCount = service.getChapters(-1)?.size ?: 0
+        if (chaptersCount > 1) options.add(PlayerOption(ID_CHAPTER_TITLE, R.attr.ic_chapter_normal_style, res.getString(R.string.go_to_chapter)))
         options.add(PlayerOption(ID_ABREPEAT, R.attr.ic_abrepeat, res.getString(R.string.ab_repeat)))
         options.add(PlayerOption(ID_SAVE_PLAYLIST, R.attr.ic_save, res.getString(R.string.playlist_save)))
         if (service.playlistManager.player.canDoPassthrough() && settings.getString("aout", "0") == "0")



More information about the Android mailing list