Skip to content
Snippets Groups Projects
Commit a31a5b50 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix the header shuffle visibility on non large screens

parent 6a88748a
No related branches found
No related tags found
1 merge request!1193Tablet UI
......@@ -18,6 +18,10 @@
<variable
name="ab_repeat_b"
type="Float" />
<variable
name="can_shuffle"
type="Boolean" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -104,7 +108,7 @@
android:focusable="true"
android:onClick="@{fragment::onShuffleClick}"
android:padding="8dp"
android:visibility="@{fragment.isTablet() ? View.VISIBLE : View.GONE}"
android:visibility="@{fragment.isTablet() &amp;&amp; can_shuffle ? View.VISIBLE : View.GONE}"
app:layout_constraintBottom_toBottomOf="@id/header_large_play_pause"
app:layout_constraintEnd_toStartOf="@+id/header_previous"
app:layout_constraintHorizontal_bias="0.5"
......@@ -624,6 +628,7 @@
android:elevation="4dp"
android:focusable="true"
android:onClick="@{fragment::onShuffleClick}"
android:visibility="@{can_shuffle ? View.VISIBLE : View.INVISIBLE}"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintEnd_toStartOf="@+id/previous"
......
......@@ -343,7 +343,7 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
private fun updateShuffleMode() {
val ctx = context ?: return
val shuffleButtons = arrayOf(binding.shuffle, binding.headerShuffle)
shuffleButtons.forEach { it.visibility = if (playlistModel.canShuffle) View.VISIBLE else View.INVISIBLE }
binding.canShuffle = playlistModel.canShuffle
val shuffling = playlistModel.shuffling
if (wasShuffling == shuffling) return
shuffleButtons.forEach {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment