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:
parent
c3a61e6071
commit
c19680c1f7
6 changed files with 12 additions and 108 deletions
|
@ -106,4 +106,10 @@ class ArtistDetailFragment : DetailFragment() {
|
||||||
|
|
||||||
return binding.root
|
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.navigation.fragment.findNavController
|
||||||
import androidx.transition.Fade
|
import androidx.transition.Fade
|
||||||
import androidx.transition.TransitionManager
|
import androidx.transition.TransitionManager
|
||||||
import org.oxycblt.auxio.MainFragmentDirections
|
|
||||||
import org.oxycblt.auxio.R
|
import org.oxycblt.auxio.R
|
||||||
import org.oxycblt.auxio.databinding.FragmentLibraryBinding
|
import org.oxycblt.auxio.databinding.FragmentLibraryBinding
|
||||||
import org.oxycblt.auxio.library.adapters.LibraryAdapter
|
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.")
|
Log.d(this::class.simpleName, "Fragment created.")
|
||||||
|
|
||||||
return binding.root
|
return binding.root
|
||||||
|
|
|
@ -49,17 +49,10 @@ class CompactPlaybackFragment : Fragment() {
|
||||||
binding.song = MusicStore.getInstance().songs[0]
|
binding.song = MusicStore.getInstance().songs[0]
|
||||||
binding.playbackModel = playbackModel
|
binding.playbackModel = playbackModel
|
||||||
|
|
||||||
binding.root.apply {
|
binding.root.setOnClickListener {
|
||||||
setOnClickListener {
|
findNavController().navigate(
|
||||||
findNavController().navigate(
|
MainFragmentDirections.actionGoToPlayback()
|
||||||
MainFragmentDirections.actionGoToPlayback()
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
setOnLongClickListener {
|
|
||||||
playbackModel.navigateToPlayingSong()
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- VIEWMODEL SETUP ---
|
// --- VIEWMODEL SETUP ---
|
||||||
|
|
|
@ -19,6 +19,7 @@ import org.oxycblt.auxio.playback.state.PlaybackStateManager
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ViewModel that provides a UI-Focused frontend for [PlaybackStateManager].
|
* The ViewModel that provides a UI-Focused frontend for [PlaybackStateManager].
|
||||||
|
* TODO: Implement navigation to playing album/artist
|
||||||
* @author OxygenCobalt
|
* @author OxygenCobalt
|
||||||
*/
|
*/
|
||||||
class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||||
|
@ -59,9 +60,6 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||||
private val mIsSeeking = MutableLiveData(false)
|
private val mIsSeeking = MutableLiveData(false)
|
||||||
val isSeeking: LiveData<Boolean> get() = mIsSeeking
|
val isSeeking: LiveData<Boolean> get() = mIsSeeking
|
||||||
|
|
||||||
private val mNavToPlayingSong = MutableLiveData(false)
|
|
||||||
val navToPlayingSong: LiveData<Boolean> get() = mNavToPlayingSong
|
|
||||||
|
|
||||||
val formattedPosition = Transformations.map(mPosition) {
|
val formattedPosition = Transformations.map(mPosition) {
|
||||||
it.toDuration()
|
it.toDuration()
|
||||||
}
|
}
|
||||||
|
@ -265,14 +263,6 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
|
||||||
mIsSeeking.value = value
|
mIsSeeking.value = value
|
||||||
}
|
}
|
||||||
|
|
||||||
fun navigateToPlayingSong() {
|
|
||||||
mNavToPlayingSong.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
fun doneWithNavToPlayingSong() {
|
|
||||||
mNavToPlayingSong.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- OVERRIDES ---
|
// --- OVERRIDES ---
|
||||||
|
|
||||||
override fun onCleared() {
|
override fun onCleared() {
|
||||||
|
|
|
@ -86,6 +86,7 @@
|
||||||
android:layout_marginStart="@dimen/margin_medium"
|
android:layout_marginStart="@dimen/margin_medium"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:background="@drawable/ui_ripple"
|
||||||
android:onClick="@{() -> detailModel.doNavToParent()}"
|
android:onClick="@{() -> detailModel.doNavToParent()}"
|
||||||
android:text="@{album.artist.name}"
|
android:text="@{album.artist.name}"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||||
|
|
|
@ -25,27 +25,6 @@
|
||||||
android:name="org.oxycblt.auxio.MainFragment"
|
android:name="org.oxycblt.auxio.MainFragment"
|
||||||
android:label="MainFragment"
|
android:label="MainFragment"
|
||||||
tools:layout="@layout/fragment_main">
|
tools:layout="@layout/fragment_main">
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_artist"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/artist_detail_fragment" />
|
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_album"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/album_detail_fragment" />
|
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_genre"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/genre_detail_fragment" />
|
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_return_to_loading"
|
android:id="@+id/action_return_to_loading"
|
||||||
app:destination="@id/loading_fragment"
|
app:destination="@id/loading_fragment"
|
||||||
|
@ -59,58 +38,6 @@
|
||||||
app:popEnterAnim="@anim/anim_stationary"
|
app:popEnterAnim="@anim/anim_stationary"
|
||||||
app:popExitAnim="@anim/anim_nav_slide_down" />
|
app:popExitAnim="@anim/anim_nav_slide_down" />
|
||||||
</fragment>
|
</fragment>
|
||||||
<fragment
|
|
||||||
android:id="@+id/artist_detail_fragment"
|
|
||||||
android:name="org.oxycblt.auxio.detail.ArtistDetailFragment"
|
|
||||||
android:label="ArtistDetailFragment"
|
|
||||||
tools:layout="@layout/fragment_artist_detail">
|
|
||||||
<argument
|
|
||||||
android:name="artistId"
|
|
||||||
app:argType="long" />
|
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_album"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/album_detail_fragment"
|
|
||||||
app:launchSingleTop="true" />
|
|
||||||
</fragment>
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/album_detail_fragment"
|
|
||||||
android:name="org.oxycblt.auxio.detail.AlbumDetailFragment"
|
|
||||||
android:label="AlbumDetailFragment"
|
|
||||||
tools:layout="@layout/fragment_album_detail">
|
|
||||||
<argument
|
|
||||||
android:name="albumId"
|
|
||||||
app:argType="long" />
|
|
||||||
<argument
|
|
||||||
android:name="enableParentNav"
|
|
||||||
app:argType="boolean" />
|
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_parent_artist"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/artist_detail_fragment" />
|
|
||||||
</fragment>
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/genre_detail_fragment"
|
|
||||||
android:name="org.oxycblt.auxio.detail.GenreDetailFragment"
|
|
||||||
android:label="GenreDetailFragment"
|
|
||||||
tools:layout="@layout/fragment_genre_detail">
|
|
||||||
<action
|
|
||||||
android:id="@+id/action_show_artist"
|
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim"
|
|
||||||
app:destination="@id/artist_detail_fragment" />
|
|
||||||
<argument
|
|
||||||
android:name="genreId"
|
|
||||||
app:argType="long" />
|
|
||||||
</fragment>
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/playback_fragment"
|
android:id="@+id/playback_fragment"
|
||||||
android:name="org.oxycblt.auxio.playback.PlaybackFragment"
|
android:name="org.oxycblt.auxio.playback.PlaybackFragment"
|
||||||
|
|
Loading…
Reference in a new issue