diff --git a/app/src/main/java/eu/kanade/presentation/library/components/LibraryPager.kt b/app/src/main/java/eu/kanade/presentation/library/components/LibraryPager.kt index 763587eb6..7c32ee09b 100644 --- a/app/src/main/java/eu/kanade/presentation/library/components/LibraryPager.kt +++ b/app/src/main/java/eu/kanade/presentation/library/components/LibraryPager.kt @@ -11,7 +11,7 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -69,7 +69,7 @@ fun LibraryPager( remember(isLandscape) { getColumnsForOrientation(isLandscape) } } else { - remember { mutableStateOf(0) } + remember { mutableIntStateOf(0) } } when (displayMode) { diff --git a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt index 1d2c27e8c..3a8dfe075 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt @@ -32,7 +32,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment @@ -488,7 +488,7 @@ fun MangaScreenLargeImpl( val chapters = remember(state) { state.processedChapters.toList() } val insetPadding = WindowInsets.systemBars.only(WindowInsetsSides.Horizontal).asPaddingValues() - var topBarHeight by remember { mutableStateOf(0) } + var topBarHeight by remember { mutableIntStateOf(0) } PullRefresh( refreshing = state.isRefreshingData, onRefresh = onRefresh, diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt index 5ba73ed92..953f2c3d7 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaChapterListItem.kt @@ -34,6 +34,7 @@ import androidx.compose.material3.contentColorFor import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue @@ -191,7 +192,7 @@ fun MangaChapterListItem( horizontalArrangement = Arrangement.spacedBy(2.dp), verticalAlignment = Alignment.CenterVertically, ) { - var textHeight by remember { mutableStateOf(0) } + var textHeight by remember { mutableIntStateOf(0) } if (!read) { Icon( imageVector = Icons.Filled.Circle, diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt index 15c7014f4..538cb727e 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt @@ -48,6 +48,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable @@ -573,8 +574,8 @@ private fun MangaSummary( expanded: Boolean, modifier: Modifier = Modifier, ) { - var expandedHeight by remember { mutableStateOf(0) } - var shrunkHeight by remember { mutableStateOf(0) } + var expandedHeight by remember { mutableIntStateOf(0) } + var shrunkHeight by remember { mutableIntStateOf(0) } val heightDelta = remember(expandedHeight, shrunkHeight) { expandedHeight - shrunkHeight } val animProgress by animateFloatAsState(if (expanded) 1f else 0f) val scrimHeight = with(LocalDensity.current) { remember { 24.sp.roundToPx() } } diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt index f067af9a8..f470522f9 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt @@ -13,6 +13,7 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope @@ -165,7 +166,7 @@ object SettingsAdvancedScreen : SearchableSettings { val libraryPreferences = remember { Injekt.get() } val chapterCache = remember { Injekt.get() } - var readableSizeSema by remember { mutableStateOf(0) } + var readableSizeSema by remember { mutableIntStateOf(0) } val readableSize = remember(readableSizeSema) { chapterCache.readableSize } return Preference.PreferenceGroup( diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt index bc7acebca..ff52ce1fb 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope @@ -86,7 +87,7 @@ object SettingsBackupScreen : SearchableSettings { val scope = rememberCoroutineScope() val context = LocalContext.current - var flag by rememberSaveable { mutableStateOf(0) } + var flag by rememberSaveable { mutableIntStateOf(0) } val chooseBackupDir = rememberLauncherForActivityResult( contract = ActivityResultContracts.CreateDocument("application/*"), ) { diff --git a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt index c8496ff86..50ef6840b 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt @@ -22,7 +22,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment @@ -198,7 +198,7 @@ private fun UpdatesUiItem( ) Row(verticalAlignment = Alignment.CenterVertically) { - var textHeight by remember { mutableStateOf(0) } + var textHeight by remember { mutableIntStateOf(0) } if (!update.read) { Icon( imageVector = Icons.Filled.Circle, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt index a130516f2..2e5ed932f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/details/SourcePreferencesScreen.kt @@ -15,6 +15,7 @@ import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue @@ -93,7 +94,7 @@ class SourcePreferencesScreen(val sourceId: Long) : Screen() { commit: FragmentTransaction.(containerId: Int) -> Unit, ) { val containerId by rememberSaveable { - mutableStateOf(View.generateViewId()) + mutableIntStateOf(View.generateViewId()) } var initialized by rememberSaveable { mutableStateOf(false) } AndroidView( diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt index ee47ea68c..d9f90ad54 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/AdaptiveSheet.kt @@ -26,7 +26,7 @@ import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue @@ -61,7 +61,7 @@ fun AdaptiveSheet( ) { val scope = rememberCoroutineScope() if (isTabletUi) { - var targetAlpha by remember { mutableStateOf(0f) } + var targetAlpha by remember { mutableFloatStateOf(0f) } val alpha by animateFloatAsState( targetValue = targetAlpha, animationSpec = SheetAnimationSpec, diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt index b7d769f35..a0589f1d9 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt @@ -28,7 +28,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier @@ -83,7 +83,7 @@ fun VerticalFastScroller( if (!showScroller) return@subcompose val thumbTopPadding = with(LocalDensity.current) { topContentPadding.toPx() } - var thumbOffsetY by remember(thumbTopPadding) { mutableStateOf(thumbTopPadding) } + var thumbOffsetY by remember(thumbTopPadding) { mutableFloatStateOf(thumbTopPadding) } val dragInteractionSource = remember { MutableInteractionSource() } val isThumbDragged by dragInteractionSource.collectIsDraggedAsState() @@ -248,7 +248,7 @@ fun VerticalGridFastScroller( val showScroller = layoutInfo.visibleItemsInfo.size < layoutInfo.totalItemsCount if (!showScroller) return@subcompose val thumbTopPadding = with(LocalDensity.current) { topContentPadding.toPx() } - var thumbOffsetY by remember(thumbTopPadding) { mutableStateOf(thumbTopPadding) } + var thumbOffsetY by remember(thumbTopPadding) { mutableFloatStateOf(thumbTopPadding) } val dragInteractionSource = remember { MutableInteractionSource() } val isThumbDragged by dragInteractionSource.collectIsDraggedAsState() diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt index e244d08cc..e1d2fd320 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt @@ -20,6 +20,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope @@ -113,7 +114,7 @@ private fun WheelPicker( val haptic = LocalHapticFeedback.current val lazyListState = rememberLazyListState(startIndex) - var internalIndex by remember { mutableStateOf(startIndex) } + var internalIndex by remember { mutableIntStateOf(startIndex) } val internalOnSelectionChanged: (Int) -> Unit = { internalIndex = it onSelectionChanged(it) diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/util/LazyListState.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/util/LazyListState.kt index c0b326464..1b2aa1ab8 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/util/LazyListState.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/util/LazyListState.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.lazy.LazyListState import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue @@ -30,8 +31,8 @@ fun LazyListState.isScrolledToEnd(): Boolean { @Composable fun LazyListState.isScrollingUp(): Boolean { - var previousIndex by remember { mutableStateOf(firstVisibleItemIndex) } - var previousScrollOffset by remember { mutableStateOf(firstVisibleItemScrollOffset) } + var previousIndex by remember { mutableIntStateOf(firstVisibleItemIndex) } + var previousScrollOffset by remember { mutableIntStateOf(firstVisibleItemScrollOffset) } return remember { derivedStateOf { if (previousIndex != firstVisibleItemIndex) { @@ -48,8 +49,8 @@ fun LazyListState.isScrollingUp(): Boolean { @Composable fun LazyListState.isScrollingDown(): Boolean { - var previousIndex by remember { mutableStateOf(firstVisibleItemIndex) } - var previousScrollOffset by remember { mutableStateOf(firstVisibleItemScrollOffset) } + var previousIndex by remember { mutableIntStateOf(firstVisibleItemIndex) } + var previousScrollOffset by remember { mutableIntStateOf(firstVisibleItemScrollOffset) } return remember { derivedStateOf { if (previousIndex != firstVisibleItemIndex) {