From 723d50d836a94ecbb06ad1fe3787ae2592e36bf7 Mon Sep 17 00:00:00 2001 From: SanmerDev Date: Tue, 23 Jan 2024 14:09:27 +0800 Subject: [PATCH] Use `Immutable` instead of `Stable` --- app/src/main/kotlin/dev/sanmer/pi/model/IPackageInfo.kt | 4 ++-- .../dev/sanmer/pi/ui/component/scrollbar/FastScrollbar.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/dev/sanmer/pi/model/IPackageInfo.kt b/app/src/main/kotlin/dev/sanmer/pi/model/IPackageInfo.kt index 8e952cb2..ee72c1aa 100644 --- a/app/src/main/kotlin/dev/sanmer/pi/model/IPackageInfo.kt +++ b/app/src/main/kotlin/dev/sanmer/pi/model/IPackageInfo.kt @@ -2,9 +2,9 @@ package dev.sanmer.pi.model import android.content.pm.PackageInfo import android.content.pm.PackageManager -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class IPackageInfo( val inner: PackageInfo, val packageName: String, diff --git a/app/src/main/kotlin/dev/sanmer/pi/ui/component/scrollbar/FastScrollbar.kt b/app/src/main/kotlin/dev/sanmer/pi/ui/component/scrollbar/FastScrollbar.kt index 663a5de7..9733a844 100644 --- a/app/src/main/kotlin/dev/sanmer/pi/ui/component/scrollbar/FastScrollbar.kt +++ b/app/src/main/kotlin/dev/sanmer/pi/ui/component/scrollbar/FastScrollbar.kt @@ -39,8 +39,8 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.surfaceColorAtElevation import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.Stable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -117,7 +117,7 @@ private fun ScrollableState.FastScrollbar( reverseLayout = reverseLayout ) -@Stable +@Immutable class ScrollbarColors internal constructor( private val contentColor: Color, private val activeContentColor: Color,