Temporarily remove playback nav
Remove the ability to navigate to the parent album from CompactPlaybackFragment for now, as it was causing issues.
This commit is contained in:
@@ -106,4 +106,10 @@ class ArtistDetailFragment : DetailFragment() {
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
detailModel.updateNavigationStatus(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import androidx.fragment.app.activityViewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.transition.Fade
|
||||
import androidx.transition.TransitionManager
|
||||
import org.oxycblt.auxio.MainFragmentDirections
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.FragmentLibraryBinding
|
||||
import org.oxycblt.auxio.library.adapters.LibraryAdapter
|
||||
@@ -157,18 +156,6 @@ class LibraryFragment : Fragment(), SearchView.OnQueryTextListener {
|
||||
}
|
||||
}
|
||||
|
||||
playbackModel.navToPlayingSong.observe(viewLifecycleOwner) {
|
||||
if (it) {
|
||||
findNavController().navigate(
|
||||
MainFragmentDirections.actionShowAlbum(
|
||||
playbackModel.song.value!!.album.id, true
|
||||
)
|
||||
)
|
||||
|
||||
playbackModel.doneWithNavToPlayingSong()
|
||||
}
|
||||
}
|
||||
|
||||
Log.d(this::class.simpleName, "Fragment created.")
|
||||
|
||||
return binding.root
|
||||
|
||||
@@ -49,17 +49,10 @@ class CompactPlaybackFragment : Fragment() {
|
||||
binding.song = MusicStore.getInstance().songs[0]
|
||||
binding.playbackModel = playbackModel
|
||||
|
||||
binding.root.apply {
|
||||
setOnClickListener {
|
||||
findNavController().navigate(
|
||||
MainFragmentDirections.actionGoToPlayback()
|
||||
)
|
||||
}
|
||||
|
||||
setOnLongClickListener {
|
||||
playbackModel.navigateToPlayingSong()
|
||||
true
|
||||
}
|
||||
binding.root.setOnClickListener {
|
||||
findNavController().navigate(
|
||||
MainFragmentDirections.actionGoToPlayback()
|
||||
)
|
||||
}
|
||||
|
||||
// --- VIEWMODEL SETUP ---
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
|
||||
|
||||
/**
|
||||
* The ViewModel that provides a UI-Focused frontend for [PlaybackStateManager].
|
||||
* TODO: Implement navigation to playing album/artist
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||
@@ -59,9 +60,6 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||
private val mIsSeeking = MutableLiveData(false)
|
||||
val isSeeking: LiveData<Boolean> get() = mIsSeeking
|
||||
|
||||
private val mNavToPlayingSong = MutableLiveData(false)
|
||||
val navToPlayingSong: LiveData<Boolean> get() = mNavToPlayingSong
|
||||
|
||||
val formattedPosition = Transformations.map(mPosition) {
|
||||
it.toDuration()
|
||||
}
|
||||
@@ -265,14 +263,6 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||
mIsSeeking.value = value
|
||||
}
|
||||
|
||||
fun navigateToPlayingSong() {
|
||||
mNavToPlayingSong.value = true
|
||||
}
|
||||
|
||||
fun doneWithNavToPlayingSong() {
|
||||
mNavToPlayingSong.value = false
|
||||
}
|
||||
|
||||
// --- OVERRIDES ---
|
||||
|
||||
override fun onCleared() {
|
||||
|
||||
Reference in New Issue
Block a user