diff --git a/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt b/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt index 5d76d4c7b..2740f6a23 100644 --- a/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt @@ -123,8 +123,8 @@ class HomeFragment : Fragment() { // --- VIEWMODEL SETUP --- detailModel.navToItem.observe(viewLifecycleOwner) { item -> - // Unless we wait for the AppBarLayout to be done setting up before we navigate, - // it might result in the collapsed state being lost for...reasons. + // The AppBarLayout bugs out and collapses when we navigate too fast, wait for it + // to draw before we continue. binding.homeAppbar.post { when (item) { is Song -> findNavController().navigate( diff --git a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueDragCallback.kt b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueDragCallback.kt index 51885eb1b..553afdd38 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueDragCallback.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueDragCallback.kt @@ -106,7 +106,7 @@ class QueueDragCallback(private val playbackModel: PlaybackViewModel) : ItemTouc if (shouldLift && isCurrentlyActive && actionState == ItemTouchHelper.ACTION_STATE_DRAG) { view.animate() .withStartAction { view.setBackgroundResource(R.color.surface) } - .translationZ(view.resources.getDimension(R.dimen.elevation_normal)) + .translationZ(view.resources.getDimension(R.dimen.elevation_small)) .setDuration(100) .setInterpolator(AccelerateDecelerateInterpolator()) .start() @@ -124,7 +124,7 @@ class QueueDragCallback(private val playbackModel: PlaybackViewModel) : ItemTouc val view = viewHolder.itemView if (view.translationZ != 0.0f) { - viewHolder.itemView.animate() + view.animate() .withEndAction { view.setBackgroundResource(android.R.color.transparent) } .translationZ(0.0f) .setDuration(100) diff --git a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueFragment.kt b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueFragment.kt index e4599945a..8a9437f14 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/queue/QueueFragment.kt @@ -36,11 +36,12 @@ import org.oxycblt.auxio.music.BaseModel import org.oxycblt.auxio.music.Header import org.oxycblt.auxio.playback.PlaybackViewModel import org.oxycblt.auxio.util.isEdgeOn -import org.oxycblt.auxio.util.isIrregularLandscape /** - * A [Fragment] that contains both the user queue and the next queue, with the ability to + * A [Fragment] that contains both the user queue and the next queue, with the abielity to * edit them as well. + * TODO: Edge can be improved here by turning off the landscape checks and simply padding the + * root view on the irregular landscape mode [I think] * @author OxygenCobalt */ class QueueFragment : Fragment() { @@ -108,8 +109,22 @@ class QueueFragment : Fragment() { } private fun setupEdgeForQueue(binding: FragmentQueueBinding) { - if (isEdgeOn() && !requireActivity().isIrregularLandscape()) { - binding.queueToolbar.setOnApplyWindowInsetsListener { v, insets -> + if (isEdgeOn()) { + // Account for the side navigation bar if required. + binding.root.setOnApplyWindowInsetsListener { v, insets -> + val right = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + insets.getInsets(WindowInsets.Type.systemBars()).right + } else { + @Suppress("DEPRECATION") + insets.systemWindowInsetRight + } + + v.updatePadding(right = right) + + insets + } + + binding.queueAppbar.setOnApplyWindowInsetsListener { v, insets -> val top = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { insets.getInsets(WindowInsets.Type.systemBars()).top } else { @@ -117,7 +132,7 @@ class QueueFragment : Fragment() { insets.systemWindowInsetTop } - (v.parent as View).updatePadding(top = top) + v.updatePadding(top = top) insets } @@ -141,7 +156,6 @@ class QueueFragment : Fragment() { insets } } else { - // Don't even bother if we are in phone landscape or if edge-to-edge is off. binding.root.fitsSystemWindows = true } } diff --git a/app/src/main/res/layout/fragment_queue.xml b/app/src/main/res/layout/fragment_queue.xml index b2005f453..0d0e82577 100644 --- a/app/src/main/res/layout/fragment_queue.xml +++ b/app/src/main/res/layout/fragment_queue.xml @@ -4,18 +4,29 @@ xmlns:tools="http://schemas.android.com/tools" tools:context=".playback.queue.QueueFragment"> - - + + + + + + - + \ No newline at end of file diff --git a/info/ADDITIONS.md b/info/ADDITIONS.md index 98c4a8f5d..adc200085 100644 --- a/info/ADDITIONS.md +++ b/info/ADDITIONS.md @@ -26,4 +26,5 @@ Feel free to fork Auxio to add your own feature set however. - Recently added list [#18] - Folder View/Grouping [#10] - ReplayGain [#7] -- Tag editing [#33] \ No newline at end of file +- Tag editing [#33] +- Specialized queue adding (ex. Play Next) [#44] \ No newline at end of file diff --git a/info/ARCHITECTURE.md b/info/ARCHITECTURE.md index 6fb237b96..bded68d0f 100644 --- a/info/ARCHITECTURE.md +++ b/info/ARCHITECTURE.md @@ -1,3 +1,6 @@ +**Note:** Auxio is undergoing a major refactor right now. This document may not be fully up to date. +It will be revamped when the refactor is complete. + # Architecture This document is designed to provide a simple overview of Auxio's architecture and where code resides/should reside. It will be updated as aspects about Auxio change.