Remove dependency on compose material 2 components

This commit is contained in:
AntsyLich
2024-05-07 15:53:26 +06:00
parent 8e9396a9cf
commit fb9423028e
4 changed files with 4 additions and 8 deletions

View File

@ -21,7 +21,6 @@ dependencies {
implementation(compose.activity)
implementation(compose.foundation)
implementation(compose.material3.core)
implementation(compose.material.core)
implementation(compose.material.icons)
implementation(compose.animation)
implementation(compose.animation.graphics)

View File

@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyGridScope
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material.ContentAlpha
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowDownward
import androidx.compose.material.icons.filled.ArrowUpward
@ -56,6 +55,8 @@ object SettingsItemsPaddings {
val Vertical = 10.dp
}
private const val DisabledContentAlpha = 0.38f
@Composable
fun HeadingItem(labelRes: StringResource) {
HeadingItem(stringResource(labelRes))
@ -278,7 +279,7 @@ fun TriStateItem(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.large),
) {
val stateAlpha = if (enabled && onClick != null) 1f else ContentAlpha.disabled
val stateAlpha = if (enabled && onClick != null) 1f else DisabledContentAlpha
Icon(
imageVector = when (state) {
@ -291,7 +292,7 @@ fun TriStateItem(
MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = stateAlpha)
} else {
when (onClick) {
null -> MaterialTheme.colorScheme.onSurface.copy(alpha = ContentAlpha.disabled)
null -> MaterialTheme.colorScheme.onSurface.copy(alpha = DisabledContentAlpha)
else -> MaterialTheme.colorScheme.primary
}
},