Replace our custom Pager (#9494)

Turns out that changing the pagerSnapDistance
is enough to achieve the same result.

(cherry picked from commit 96defd6b054101c540dc62907e43f4aa5db1ef6c)
This commit is contained in:
Ivan Iskandar
2023-05-13 23:06:00 +07:00
committed by Jobobby04
parent beb62884d0
commit 7ea6f685bf
6 changed files with 47 additions and 288 deletions
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material3.Icon
@@ -31,7 +32,6 @@ import kotlinx.coroutines.launch
import tachiyomi.presentation.core.components.HorizontalPager
import tachiyomi.presentation.core.components.material.Divider
import tachiyomi.presentation.core.components.material.TabIndicator
import tachiyomi.presentation.core.components.rememberPagerState
object TabbedDialogPaddings {
val Horizontal = 24.dp
@@ -84,7 +84,7 @@ fun TabbedDialog(
HorizontalPager(
modifier = Modifier.animateContentSize(),
count = tabTitles.size,
pageCount = tabTitles.size,
state = pagerState,
verticalAlignment = Alignment.Top,
) { page ->
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
@@ -25,7 +26,6 @@ import tachiyomi.presentation.core.components.HorizontalPager
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.TabIndicator
import tachiyomi.presentation.core.components.material.TabText
import tachiyomi.presentation.core.components.rememberPagerState
@Composable
fun TabbedScreen(
@@ -82,7 +82,7 @@ fun TabbedScreen(
}
HorizontalPager(
count = tabs.size,
pageCount = tabs.size,
modifier = Modifier.fillMaxSize(),
state = state,
verticalAlignment = Alignment.Top,