[Android] Bookmarks visibility factorisation
Nicolas Pomepuy
git at videolan.org
Wed Jul 12 13:10:26 UTC 2023
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul 11 07:11:46 2023 +0200| [bce48ac64b42603c1bcba1696354d1e19733953a] | committer: Nicolas Pomepuy
Bookmarks visibility factorisation
> https://code.videolan.org/videolan/vlc-android/commit/bce48ac64b42603c1bcba1696354d1e19733953a
---
.../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index c3564d40ce..4bf0282c83 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -515,7 +515,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
}
}
- private fun shouldHidePlayProgress() = abRepeatAddMarker.visibility != View.GONE || (::bookmarkListDelegate.isInitialized && bookmarkListDelegate.visible) || playlistModel.medias?.size ?: 0 < 2
+ private fun shouldHidePlayProgress() = abRepeatAddMarker.visibility != View.GONE || areBookmarksVisible() || playlistModel.medias?.size ?: 0 < 2
override fun onSelectionSet(position: Int) {
binding.songsList.scrollToPosition(position)
@@ -681,13 +681,15 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
optionsDelegate.hide()
return true
}
- if (::bookmarkListDelegate.isInitialized && bookmarkListDelegate.visible) {
+ if (areBookmarksVisible()) {
bookmarkListDelegate.hide()
return true
}
return clearSearch()
}
+ fun areBookmarksVisible() = ::bookmarkListDelegate.isInitialized && bookmarkListDelegate.visible
+
fun clearSearch(): Boolean {
if (this::playlistModel.isInitialized) playlistModel.filter(null)
return hideSearchField()
More information about the Android
mailing list