mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
Update dependencies
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package ca.gosyer.jui.domain.library.model
|
||||
|
||||
import androidx.compose.runtime.Stable
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Stable
|
||||
enum class JobStatus {
|
||||
PENDING,
|
||||
RUNNING,
|
||||
COMPLETE,
|
||||
FAILED,
|
||||
}
|
||||
@@ -1,76 +1,76 @@
|
||||
[versions]
|
||||
# Kotlin
|
||||
kotlin = "1.9.21"
|
||||
coroutines = "1.7.3"
|
||||
kotlin = "1.9.23"
|
||||
coroutines = "1.8.0"
|
||||
|
||||
# Serialization
|
||||
json = "1.6.2"
|
||||
json = "1.6.3"
|
||||
|
||||
# Compose
|
||||
composeGradle = "1.5.11"
|
||||
composeGradle = "1.6.1"
|
||||
|
||||
# Compose Libraries
|
||||
voyager = "1.0.0-rc10"
|
||||
accompanist = "0.30.1"
|
||||
googleAccompanist = "0.30.1"
|
||||
imageloader = "1.7.1"
|
||||
materialDialogs = "0.9.4"
|
||||
imageloader = "1.7.8"
|
||||
materialDialogs = "0.9.5"
|
||||
|
||||
# Android
|
||||
androidGradle = "8.1.4"
|
||||
androidGradle = "8.3.1"
|
||||
core = "1.12.0"
|
||||
appCompat = "1.7.0-alpha03"
|
||||
activityCompose = "1.8.1"
|
||||
activityCompose = "1.8.2"
|
||||
work = "2.9.0"
|
||||
|
||||
# Android Lifecycle
|
||||
lifecycle = "2.6.2"
|
||||
lifecycle = "2.7.0"
|
||||
|
||||
# Swing
|
||||
darklaf = "3.0.2"
|
||||
|
||||
# Ksp
|
||||
ksp = "1.9.21-1.0.15"
|
||||
ksp = "1.9.23-1.0.19"
|
||||
|
||||
# Dependency Injection
|
||||
kotlinInject = "0.6.3"
|
||||
|
||||
# Network
|
||||
ktor = "2.3.6"
|
||||
ktorfit = "1.10.2"
|
||||
ktor = "2.3.9"
|
||||
ktorfit = "1.12.0"
|
||||
|
||||
# Logging
|
||||
slf4j = "2.0.9"
|
||||
log4j = "2.22.0"
|
||||
kmlogging = "1.3.0"
|
||||
slf4j = "2.0.12"
|
||||
log4j = "2.23.1"
|
||||
kmlogging = "1.4.2"
|
||||
|
||||
# Storage
|
||||
okio = "3.6.0"
|
||||
appDirs = "1.1.1"
|
||||
okio = "3.9.0"
|
||||
appDirs = "1.2.0"
|
||||
|
||||
# Preferences
|
||||
multiplatformSettings = "1.0.0-alpha01"
|
||||
|
||||
# Utility
|
||||
desugarJdkLibs = "2.0.4"
|
||||
aboutLibraries = "10.9.2"
|
||||
dateTime = "0.5.0"
|
||||
immutableCollections = "0.3.6"
|
||||
korge = "5.1.0"
|
||||
aboutLibraries = "11.1.1"
|
||||
dateTime = "0.6.0-RC.2"
|
||||
immutableCollections = "0.3.7"
|
||||
korge = "5.4.0"
|
||||
gradleDownloadTask = "5.4.0"
|
||||
|
||||
# Localization
|
||||
moko = "0.23.0"
|
||||
|
||||
# BuildConfigs
|
||||
buildconfig = "4.2.0"
|
||||
buildconfig = "5.3.5"
|
||||
buildkonfig = "0.15.1"
|
||||
|
||||
# Linter
|
||||
kotlinter = "4.1.0"
|
||||
kotlinter = "4.3.0"
|
||||
|
||||
# Version updates
|
||||
versions = "0.50.0"
|
||||
versions = "0.51.0"
|
||||
|
||||
# Optimizer
|
||||
proguard = "7.4.1"
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
17
gradlew
vendored
17
gradlew
vendored
@@ -83,7 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -201,11 +202,11 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
|
||||
@@ -40,4 +40,5 @@ fun getMaterialDialogProperties(
|
||||
windowTitle = title,
|
||||
windowIcon = icon,
|
||||
windowIsResizable = resizable,
|
||||
isWindowDialog = false,
|
||||
)
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.seiko.imageloader.component.ComponentRegistryBuilder
|
||||
import com.seiko.imageloader.component.fetcher.MokoResourceFetcher
|
||||
import com.seiko.imageloader.component.keyer.Keyer
|
||||
import com.seiko.imageloader.component.mapper.Mapper
|
||||
import com.seiko.imageloader.intercept.bitmapMemoryCacheConfig
|
||||
import com.seiko.imageloader.option.Options
|
||||
import com.seiko.imageloader.option.OptionsBuilder
|
||||
import io.ktor.http.Url
|
||||
@@ -56,7 +57,7 @@ class ImageLoaderProvider
|
||||
}
|
||||
interceptor {
|
||||
diskCache { imageCache }
|
||||
memoryCacheConfig { configure(context) }
|
||||
bitmapMemoryCacheConfig { configure(context) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ import androidx.compose.material.Surface
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.contentColorFor
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.ArrowBack
|
||||
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
|
||||
import androidx.compose.material.icons.automirrored.rounded.Sort
|
||||
import androidx.compose.material.icons.rounded.Close
|
||||
import androidx.compose.material.icons.rounded.Search
|
||||
import androidx.compose.material.icons.rounded.Sort
|
||||
import androidx.compose.material.ripple.rememberRipple
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
@@ -168,7 +168,11 @@ private fun WideToolbar(
|
||||
AnimatedVisibility(
|
||||
!displayController.sideMenuVisible,
|
||||
) {
|
||||
ActionIcon(displayController::openSideMenu, "Open nav", Icons.Rounded.Sort)
|
||||
ActionIcon(
|
||||
displayController::openSideMenu,
|
||||
"Open nav",
|
||||
Icons.AutoMirrored.Rounded.Sort,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +261,7 @@ private fun ThinToolbar(
|
||||
},
|
||||
) {
|
||||
Icon(
|
||||
if (closeIcon === ToolbarDefault) Icons.Rounded.ArrowBack else closeIcon,
|
||||
if (closeIcon === ToolbarDefault) Icons.AutoMirrored.Rounded.ArrowBack else closeIcon,
|
||||
stringResource(MR.strings.action_close),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -28,12 +28,10 @@ import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxScope
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.defaultMinSize
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
@@ -284,7 +282,7 @@ fun <T> ChoiceDialog(
|
||||
submit()
|
||||
},
|
||||
)
|
||||
Box(Modifier.matchParentSize().height(IntrinsicSize.Min)) {
|
||||
Box(Modifier.matchParentSize()) {
|
||||
VerticalScrollbar(
|
||||
rememberScrollbarAdapter(listState),
|
||||
Modifier.align(Alignment.CenterEnd)
|
||||
@@ -332,7 +330,7 @@ fun <T> MultiSelectDialog(
|
||||
onFinished(indexes.map { items[it].first }.toImmutableList())
|
||||
},
|
||||
)
|
||||
Box(Modifier.matchParentSize().height(IntrinsicSize.Min)) {
|
||||
Box(Modifier.matchParentSize()) {
|
||||
VerticalScrollbar(
|
||||
rememberScrollbarAdapter(listState),
|
||||
Modifier.align(Alignment.CenterEnd)
|
||||
|
||||
@@ -37,7 +37,7 @@ import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.List
|
||||
import androidx.compose.material.icons.automirrored.outlined.List
|
||||
import androidx.compose.material.icons.rounded.Add
|
||||
import androidx.compose.material.icons.rounded.Delete
|
||||
import androidx.compose.material.icons.rounded.Edit
|
||||
@@ -183,7 +183,7 @@ private fun CategoryRow(
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.List,
|
||||
imageVector = Icons.AutoMirrored.Outlined.List,
|
||||
modifier = Modifier.padding(16.dp),
|
||||
tint = MaterialTheme.colors.primary,
|
||||
contentDescription = null,
|
||||
|
||||
@@ -9,7 +9,6 @@ package ca.gosyer.jui.ui.extensions.components
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
@@ -318,7 +317,7 @@ fun LanguageDialog(
|
||||
setLangs(indexes.map { list[it].first }.toSet())
|
||||
},
|
||||
)
|
||||
Box(Modifier.matchParentSize().height(IntrinsicSize.Min)) {
|
||||
Box(Modifier.matchParentSize()) {
|
||||
VerticalScrollbar(
|
||||
rememberScrollbarAdapter(listState),
|
||||
Modifier.align(Alignment.CenterEnd)
|
||||
|
||||
@@ -35,7 +35,6 @@ import ca.gosyer.jui.uicore.components.scrollbarPadding
|
||||
import ca.gosyer.jui.uicore.resources.stringResource
|
||||
import com.mikepenz.aboutlibraries.Libs
|
||||
import com.mikepenz.aboutlibraries.ui.compose.Libraries
|
||||
import com.mikepenz.aboutlibraries.ui.compose.util.StableLibrary
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
|
||||
@Composable
|
||||
@@ -59,10 +58,10 @@ fun LicensesContent() {
|
||||
val state = rememberLazyListState()
|
||||
val uriHandler = LocalUriHandler.current
|
||||
Libraries(
|
||||
libraries = remember(libs) { libs.libraries.map { StableLibrary(it) }.toImmutableList() },
|
||||
libraries = remember(libs) { libs.libraries.toImmutableList() },
|
||||
lazyListState = state,
|
||||
onLibraryClick = {
|
||||
it.library.website?.let(uriHandler::openUri)
|
||||
it.website?.let(uriHandler::openUri)
|
||||
},
|
||||
contentPadding = WindowInsets.bottomNav.add(
|
||||
WindowInsets.navigationBars.only(
|
||||
|
||||
@@ -194,7 +194,7 @@ fun CategorySelectDialog(
|
||||
onPositiveClick(indexes.map { categories[it] }, oldCategories)
|
||||
},
|
||||
)
|
||||
Box(Modifier.matchParentSize().height(IntrinsicSize.Min)) {
|
||||
Box(Modifier.matchParentSize()) {
|
||||
VerticalScrollbar(
|
||||
rememberScrollbarAdapter(listState),
|
||||
Modifier.align(Alignment.CenterEnd)
|
||||
|
||||
@@ -25,6 +25,7 @@ import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.rounded.Label
|
||||
import androidx.compose.material.icons.rounded.BookmarkAdd
|
||||
import androidx.compose.material.icons.rounded.BookmarkRemove
|
||||
import androidx.compose.material.icons.rounded.Close
|
||||
@@ -34,7 +35,6 @@ import androidx.compose.material.icons.rounded.Download
|
||||
import androidx.compose.material.icons.rounded.Favorite
|
||||
import androidx.compose.material.icons.rounded.FavoriteBorder
|
||||
import androidx.compose.material.icons.rounded.FlipToBack
|
||||
import androidx.compose.material.icons.rounded.Label
|
||||
import androidx.compose.material.icons.rounded.Public
|
||||
import androidx.compose.material.icons.rounded.Refresh
|
||||
import androidx.compose.material.icons.rounded.RemoveDone
|
||||
@@ -312,7 +312,7 @@ private fun getActionItems(
|
||||
if (categoryItemVisible) {
|
||||
ActionItem(
|
||||
name = stringResource(MR.strings.edit_categories),
|
||||
icon = Icons.Rounded.Label,
|
||||
icon = Icons.AutoMirrored.Rounded.Label,
|
||||
doAction = setCategories,
|
||||
)
|
||||
} else {
|
||||
|
||||
@@ -36,9 +36,9 @@ import androidx.compose.material.Surface
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextButton
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.rounded.NavigateBefore
|
||||
import androidx.compose.material.icons.automirrored.rounded.NavigateNext
|
||||
import androidx.compose.material.icons.rounded.ChevronLeft
|
||||
import androidx.compose.material.icons.rounded.NavigateBefore
|
||||
import androidx.compose.material.icons.rounded.NavigateNext
|
||||
import androidx.compose.material.icons.rounded.SkipNext
|
||||
import androidx.compose.material.icons.rounded.SkipPrevious
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -318,7 +318,7 @@ private fun NavigateChapters(
|
||||
OutlinedButton(loadPrevChapter, Modifier.weight(0.5F)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
val nextChapter = stringResource(MR.strings.nav_prev_chapter)
|
||||
Icon(Icons.Rounded.NavigateBefore, nextChapter)
|
||||
Icon(Icons.AutoMirrored.Rounded.NavigateBefore, nextChapter)
|
||||
Text(nextChapter, fontSize = 10.sp)
|
||||
}
|
||||
}
|
||||
@@ -326,7 +326,7 @@ private fun NavigateChapters(
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
val nextChapter = stringResource(MR.strings.nav_next_chapter)
|
||||
Text(nextChapter, fontSize = 10.sp)
|
||||
Icon(Icons.Rounded.NavigateNext, nextChapter)
|
||||
Icon(Icons.AutoMirrored.Rounded.NavigateNext, nextChapter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.rounded.ChromeReaderMode
|
||||
import androidx.compose.material.icons.rounded.Backup
|
||||
import androidx.compose.material.icons.rounded.ChromeReaderMode
|
||||
import androidx.compose.material.icons.rounded.Code
|
||||
import androidx.compose.material.icons.rounded.CollectionsBookmark
|
||||
import androidx.compose.material.icons.rounded.Computer
|
||||
@@ -110,7 +110,7 @@ fun SettingsScreenContent(navigator: Navigator) {
|
||||
item {
|
||||
PreferenceRow(
|
||||
title = stringResource(MR.strings.settings_reader),
|
||||
icon = Icons.Rounded.ChromeReaderMode,
|
||||
icon = Icons.AutoMirrored.Rounded.ChromeReaderMode,
|
||||
onClick = { navigator push SettingsReaderScreen() },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import androidx.compose.material.Icon
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.ArrowForward
|
||||
import androidx.compose.material.icons.automirrored.rounded.ArrowForward
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -185,7 +185,7 @@ fun GlobalSearchItem(
|
||||
fontSize = 12.sp,
|
||||
)
|
||||
}
|
||||
Icon(Icons.Rounded.ArrowForward, stringResource(MR.strings.action_search))
|
||||
Icon(Icons.AutoMirrored.Rounded.ArrowForward, stringResource(MR.strings.action_search))
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(4.dp))
|
||||
|
||||
@@ -56,8 +56,8 @@ class UpdatesScreenViewModel
|
||||
private val _isLoading = MutableStateFlow(true)
|
||||
val isLoading = _isLoading.asStateFlow()
|
||||
|
||||
val updates = updatesPager.updates.map {
|
||||
it.map {
|
||||
val updates = updatesPager.updates.map { updates ->
|
||||
updates.map {
|
||||
when (it) {
|
||||
is UpdatesPager.Updates.Date -> UpdatesUI.Header(it.date)
|
||||
is UpdatesPager.Updates.Update -> UpdatesUI.Item(ChapterDownloadItem(it.manga, it.chapter))
|
||||
|
||||
@@ -36,10 +36,8 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Density
|
||||
import androidx.compose.ui.util.fastForEach
|
||||
import androidx.compose.ui.util.fastMaxBy
|
||||
import androidx.compose.ui.util.fastSumBy
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.sign
|
||||
@@ -242,9 +240,9 @@ private fun lazyListSnapLayoutInfoProvider(
|
||||
get() = lazyListState.layoutInfo
|
||||
|
||||
// Single page snapping is the default
|
||||
override fun Density.calculateApproachOffset(initialVelocity: Float): Float = 0f
|
||||
override fun calculateApproachOffset(initialVelocity: Float): Float = 0f
|
||||
|
||||
override fun Density.calculateSnappingOffset(currentVelocity: Float): Float {
|
||||
override fun calculateSnappingOffset(currentVelocity: Float): Float {
|
||||
var lowerBoundOffset = Float.NEGATIVE_INFINITY
|
||||
var upperBoundOffset = Float.POSITIVE_INFINITY
|
||||
|
||||
@@ -279,7 +277,7 @@ private fun lazyListSnapLayoutInfoProvider(
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
private fun Density.calculateDistanceToDesiredSnapPosition(
|
||||
private fun calculateDistanceToDesiredSnapPosition(
|
||||
mainAxisViewPortSize: Int,
|
||||
beforeContentPadding: Int,
|
||||
afterContentPadding: Int,
|
||||
@@ -291,7 +289,7 @@ private fun lazyListSnapLayoutInfoProvider(
|
||||
val containerSize = mainAxisViewPortSize - beforeContentPadding - afterContentPadding
|
||||
|
||||
val desiredDistance = with(snapPositionInLayout) {
|
||||
position(containerSize, itemSize, itemIndex)
|
||||
position(containerSize, itemSize, beforeContentPadding, afterContentPadding, itemIndex)
|
||||
}.toFloat()
|
||||
|
||||
return itemOffset - desiredDistance
|
||||
@@ -326,15 +324,6 @@ private fun lazyListSnapLayoutInfoProvider(
|
||||
0f
|
||||
}
|
||||
}
|
||||
|
||||
override fun Density.calculateSnapStepSize(): Float =
|
||||
with(layoutInfo) {
|
||||
if (visibleItemsInfo.isNotEmpty()) {
|
||||
visibleItemsInfo.fastSumBy { it.size } / visibleItemsInfo.size.toFloat()
|
||||
} else {
|
||||
0f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user