Fix quality issues on Composables

This commit is contained in:
Benoit Marty 2025-06-26 13:01:55 +02:00 committed by Benoit Marty
parent 963a19239a
commit 1ee94a492a
3 changed files with 10 additions and 4 deletions

View file

@ -36,6 +36,8 @@ private const val MAX_COUNT_STRING = "+$MAX_COUNT"
* @param count The number to display. If the number is greater than [MAX_COUNT], the counter will display [MAX_COUNT_STRING]. * @param count The number to display. If the number is greater than [MAX_COUNT], the counter will display [MAX_COUNT_STRING].
* If the number is less than 1, the counter will not be displayed. * If the number is less than 1, the counter will not be displayed.
* @param modifier The modifier to apply to this layout. * @param modifier The modifier to apply to this layout.
* @param textStyle The style to apply to the text inside the counter.
* @param isCritical If true, the counter will use a critical color scheme, otherwise it will use an accent color scheme.
*/ */
@Composable @Composable
fun CounterAtom( fun CounterAtom(

View file

@ -19,16 +19,17 @@ import io.element.android.libraries.designsystem.atomic.atoms.CounterAtom
@Composable @Composable
fun NavigationBarIcon( fun NavigationBarIcon(
imageVector: ImageVector, imageVector: ImageVector,
count: Int, modifier: Modifier = Modifier,
isCritical: Boolean, count: Int = 0,
isCritical: Boolean = false,
) { ) {
Box { Box(modifier) {
Icon( Icon(
imageVector = imageVector, imageVector = imageVector,
contentDescription = null, contentDescription = null,
) )
CounterAtom( CounterAtom(
modifier = Modifier.Companion.offset(11.dp, (-11).dp), modifier = Modifier.offset(11.dp, (-11).dp),
textStyle = ElementTheme.typography.fontBodyXsMedium, textStyle = ElementTheme.typography.fontBodyXsMedium,
count = count, count = count,
isCritical = isCritical, isCritical = isCritical,

View file

@ -8,13 +8,16 @@
package io.element.android.libraries.designsystem.theme.components package io.element.android.libraries.designsystem.theme.components
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import io.element.android.compound.theme.ElementTheme import io.element.android.compound.theme.ElementTheme
@Composable @Composable
fun NavigationBarText( fun NavigationBarText(
text: String, text: String,
modifier: Modifier = Modifier,
) { ) {
Text( Text(
modifier = modifier,
text = text, text = text,
style = ElementTheme.typography.fontBodySmMedium, style = ElementTheme.typography.fontBodySmMedium,
) )