Clean up some text alpha modifiers

(cherry picked from commit e56bf82c319f63ff2bdbabf68647a243bcd451d0)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/manga/components/MangaToolbar.kt
This commit is contained in:
arkon
2023-12-13 22:21:55 -05:00
committed by Jobobby04
parent 3ba70183ec
commit c0e1fccf81
6 changed files with 29 additions and 26 deletions
@@ -1,6 +1,5 @@
package tachiyomi.presentation.core.util
import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.isSystemInDarkTheme
@@ -16,6 +15,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
@@ -28,7 +28,10 @@ import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
fun Modifier.selectedBackground(isSelected: Boolean): Modifier = if (isSelected) {
composed {
val alpha = if (isSystemInDarkTheme()) 0.16f else 0.22f
Modifier.background(MaterialTheme.colorScheme.secondary.copy(alpha = alpha))
val color = MaterialTheme.colorScheme.secondary.copy(alpha = alpha)
Modifier.drawBehind {
drawRect(color)
}
}
} else {
this