Merge pull request #24 from nacabaro/cleanup

Bigger icons plus material obscurity
This commit is contained in:
nacabaro 2025-01-21 13:35:43 +01:00 committed by GitHub
commit 547318864b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -17,6 +17,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.FilterQuality
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.res.painterResource
@ -35,7 +36,7 @@ fun CharacterEntry(
modifier: Modifier = Modifier,
obscure: Boolean = false,
shape: Shape = MaterialTheme.shapes.medium,
multiplier: Int = 3,
multiplier: Int = 4,
onClick: () -> Unit = { }
) {
val bitmap = remember (icon.bitmap) {
@ -56,12 +57,16 @@ fun CharacterEntry(
contentAlignment = Alignment.BottomCenter,
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
.padding(4.dp)
) {
Image(
bitmap = imageBitmap,
contentDescription = "Icon",
filterQuality = FilterQuality.None,
colorFilter = when (obscure) {
true -> ColorFilter.tint(color = MaterialTheme.colorScheme.secondary)
false -> null
},
modifier = Modifier
.size(dpSize)
)

View File

@ -41,13 +41,13 @@ fun ItemElement(
.aspectRatio(1f)
) {
Box(modifier = Modifier.fillMaxSize()) {
// Background image (full size)
Icon(
painter = painterResource(id = itemIcon),
contentDescription = null,
modifier = Modifier
.size(96.dp)
.align(Alignment.Center)
.padding(16.dp)
)
Icon(
painter = painterResource(id = lengthIcon),
@ -55,9 +55,8 @@ fun ItemElement(
tint = MaterialTheme.colorScheme.surfaceTint,
modifier = Modifier
.size(48.dp) // Set the size of the overlay image
.padding(4.dp
)
.align(Alignment.TopStart) // Align to the top end (top-right corner)
.padding(8.dp)
)
}
}