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 f1f856684..f39a54e1f 100644 --- a/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/home/HomeFragment.kt @@ -52,6 +52,7 @@ import org.oxycblt.auxio.home.list.GenreListFragment import org.oxycblt.auxio.home.list.PlaylistListFragment import org.oxycblt.auxio.home.list.SongListFragment import org.oxycblt.auxio.home.tabs.AdaptiveTabStrategy +import org.oxycblt.auxio.home.tabs.Tab import org.oxycblt.auxio.list.Sort import org.oxycblt.auxio.list.selection.SelectionFragment import org.oxycblt.auxio.list.selection.SelectionViewModel @@ -152,9 +153,10 @@ class HomeFragment : setOnApplyWindowInsetsListener { _, insets -> insets } // We know that there will only be a fixed amount of tabs, so we manually set this - // limit to that. This also prevents the appbar lift state from being confused during - // page transitions. - offscreenPageLimit = homeModel.currentTabModes.size + // limit to the maximum amount possible. This will prevent the tab ripple from + // bugging out due to dynamically inflating each fragment, at the cost of slower + // debug UI performance. + offscreenPageLimit = Tab.MAX_SEQUENCE_IDX + 1 // By default, ViewPager2's sensitivity is high enough to result in vertical scroll // events being registered as horizontal scroll events. Reflect into the internal diff --git a/app/src/main/java/org/oxycblt/auxio/home/tabs/Tab.kt b/app/src/main/java/org/oxycblt/auxio/home/tabs/Tab.kt index 2fddd1b4a..5cacd084b 100644 --- a/app/src/main/java/org/oxycblt/auxio/home/tabs/Tab.kt +++ b/app/src/main/java/org/oxycblt/auxio/home/tabs/Tab.kt @@ -59,7 +59,7 @@ sealed class Tab(open val mode: MusicMode) { // MusicMode for this tab. /** The maximum index that a well-formed tab sequence should be. */ - private const val MAX_SEQUENCE_IDX = 4 + const val MAX_SEQUENCE_IDX = 4 /** * The default tab sequence, in integer form. This represents a set of four visible tabs