mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-24 13:48:55 +03:00
fix weird "explore tabs" behaviour
This commit is contained in:
parent
4baf786d57
commit
eef4ef7ef2
1 changed files with 4 additions and 5 deletions
|
@ -30,6 +30,7 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.presentation.core.components.HorizontalPager
|
||||
import tachiyomi.presentation.core.components.Scroller
|
||||
import tachiyomi.presentation.core.components.material.Scaffold
|
||||
import tachiyomi.presentation.core.components.material.TabText
|
||||
|
||||
|
@ -91,7 +92,8 @@ fun TabbedScreen(
|
|||
end = contentPadding.calculateEndPadding(LocalLayoutDirection.current),
|
||||
),
|
||||
) {
|
||||
PrimaryTabRow(
|
||||
FlexibleTabRow(
|
||||
scrollable = scrollable,
|
||||
selectedTabIndex = state.currentPage,
|
||||
) {
|
||||
tabs.forEachIndexed { index, tab ->
|
||||
|
@ -138,21 +140,18 @@ data class TabContent(
|
|||
private fun FlexibleTabRow(
|
||||
scrollable: Boolean,
|
||||
selectedTabIndex: Int,
|
||||
indicator: @Composable (List<TabPosition>) -> Unit,
|
||||
block: @Composable () -> Unit,
|
||||
) {
|
||||
return if (scrollable) {
|
||||
ScrollableTabRow(
|
||||
selectedTabIndex = selectedTabIndex,
|
||||
indicator = indicator,
|
||||
edgePadding = 13.dp,
|
||||
) {
|
||||
block()
|
||||
}
|
||||
} else {
|
||||
TabRow(
|
||||
PrimaryTabRow(
|
||||
selectedTabIndex = selectedTabIndex,
|
||||
indicator = indicator,
|
||||
) {
|
||||
block()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue