ui: use marquee in all playback info
Use marquee in all playback information. It's the playback view, and thus "activated", so why not.
This commit is contained in:
@@ -335,7 +335,7 @@ class DetailViewModel(application: Application) :
|
||||
EPS(R.string.lbl_eps),
|
||||
SINGLES(R.string.lbl_singles),
|
||||
COMPILATIONS(R.string.lbl_compilations),
|
||||
SOUNDTRACKS(R.string.lbl_compilations),
|
||||
SOUNDTRACKS(R.string.lbl_soundtracks),
|
||||
MIXES(R.string.lbl_mixes),
|
||||
MIXTAPES(R.string.lbl_mixtapes),
|
||||
LIVE(R.string.lbl_live_group),
|
||||
|
||||
@@ -21,6 +21,7 @@ import androidx.lifecycle.ViewModel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import org.oxycblt.auxio.music.system.Indexer
|
||||
import org.oxycblt.auxio.util.logD
|
||||
|
||||
/**
|
||||
* A ViewModel representing the current indexing state.
|
||||
@@ -48,6 +49,7 @@ class MusicViewModel : ViewModel(), Indexer.Callback {
|
||||
}
|
||||
|
||||
override fun onIndexerStateChanged(state: Indexer.State?) {
|
||||
logD("New state: $state")
|
||||
_indexerState.value = state
|
||||
if (state is Indexer.State.Complete && state.response is Indexer.Response.Ok) {
|
||||
_libraryExists.value = true
|
||||
|
||||
@@ -80,18 +80,25 @@ class PlaybackPanelFragment :
|
||||
setOnMenuItemClickListener(this@PlaybackPanelFragment)
|
||||
}
|
||||
|
||||
// Make sure we enable marquee on the song info
|
||||
|
||||
binding.playbackSong.apply {
|
||||
// Make marquee of the song title work
|
||||
isSelected = true
|
||||
setOnClickListener { playbackModel.song.value?.let(navModel::exploreNavigateTo) }
|
||||
}
|
||||
|
||||
binding.playbackArtist.setOnClickListener {
|
||||
playbackModel.song.value?.let { showCurrentArtist() }
|
||||
binding.playbackArtist.apply {
|
||||
isSelected = true
|
||||
setOnClickListener {
|
||||
playbackModel.song.value?.let { showCurrentArtist() }
|
||||
}
|
||||
}
|
||||
|
||||
binding.playbackAlbum.setOnClickListener {
|
||||
playbackModel.song.value?.let { showCurrentAlbum() }
|
||||
binding.playbackAlbum.apply {
|
||||
isSelected = true
|
||||
setOnClickListener {
|
||||
playbackModel.song.value?.let { showCurrentAlbum() }
|
||||
}
|
||||
}
|
||||
|
||||
binding.playbackSeekBar.callback = this
|
||||
@@ -114,7 +121,12 @@ class PlaybackPanelFragment :
|
||||
|
||||
override fun onDestroyBinding(binding: FragmentPlaybackPanelBinding) {
|
||||
binding.playbackToolbar.setOnMenuItemClickListener(null)
|
||||
|
||||
// Leaving marquee on will cause a leak
|
||||
binding.playbackSong.isSelected = false
|
||||
binding.playbackArtist.isSelected = false
|
||||
binding.playbackAlbum.isSelected = false
|
||||
|
||||
binding.playbackSeekBar.callback = null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user