[Android] Fix audio player playlist icon state
Nicolas Pomepuy
git at videolan.org
Wed Feb 23 12:49:54 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Feb 22 08:58:26 2022 +0100| [a0f4e103a820d3631613ff29e9f6f7dc4abc0ae8] | committer: Nicolas Pomepuy
Fix audio player playlist icon state
Fixes #2408
> https://code.videolan.org/videolan/vlc-android/commit/a0f4e103a820d3631613ff29e9f6f7dc4abc0ae8
---
application/vlc-android/res/layout-land/audio_player.xml | 2 +-
application/vlc-android/res/layout/audio_player.xml | 2 +-
application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 2 --
.../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt | 1 +
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/res/layout-land/audio_player.xml b/application/vlc-android/res/layout-land/audio_player.xml
index 53a71d581..f109859bc 100644
--- a/application/vlc-android/res/layout-land/audio_player.xml
+++ b/application/vlc-android/res/layout-land/audio_player.xml
@@ -362,7 +362,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/adv_function"
app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@drawable/ic_playlist_audio" />
+ app:srcCompat="@drawable/ic_playlist_audio_on" />
<ImageView
android:id="@+id/adv_function"
diff --git a/application/vlc-android/res/layout/audio_player.xml b/application/vlc-android/res/layout/audio_player.xml
index ad74c3b7d..16ff57e1c 100644
--- a/application/vlc-android/res/layout/audio_player.xml
+++ b/application/vlc-android/res/layout/audio_player.xml
@@ -317,7 +317,7 @@
app:layout_constraintBottom_toBottomOf="@id/guideline_header_bottom"
app:layout_constraintEnd_toStartOf="@+id/adv_function"
app:layout_constraintTop_toTopOf="parent"
- app:srcCompat="@drawable/ic_playlist_audio" />
+ app:srcCompat="@drawable/ic_playlist_audio_on" />
<ImageView
android:id="@+id/adv_function"
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 a7f1fe792..305c5b814 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
@@ -174,7 +174,6 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
registerForContextMenu(binding.songsList)
userVisibleHint = true
- binding.playlistSwitch.setImageResource(if (isShowingCover()) R.drawable.ic_playlist_audio else R.drawable.ic_playlist_audio_on)
binding.timeline.setOnSeekBarChangeListener(timelineListener)
//For resizing purpose, we have to cache this twice even if it's from the same resource
@@ -534,7 +533,6 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
fun onPlaylistSwitchClick(view: View) {
switchShowCover()
settings.putSingle("audio_player_show_cover", isShowingCover())
- binding.playlistSwitch.setImageResource(if (isShowingCover()) R.drawable.ic_playlist_audio else R.drawable.ic_playlist_audio_on)
lifecycleScope.launch { doUpdate() }
}
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
index 416967c39..48d41aa29 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayerAnimator.kt
@@ -105,6 +105,7 @@ internal class AudioPlayerAnimator : IAudioPlayerAnimator, LifecycleObserver {
field = value
onSlide(1F)
+ binding.playlistSwitch.setImageResource(if (value) R.drawable.ic_playlist_audio else R.drawable.ic_playlist_audio_on)
}
override fun switchShowCover() {
More information about the Android
mailing list