Fix quality issues on Composables
This commit is contained in:
parent
c5cdcc4d37
commit
bdaeaf25aa
3 changed files with 10 additions and 4 deletions
|
|
@ -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].
|
||||
* If the number is less than 1, the counter will not be displayed.
|
||||
* @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
|
||||
fun CounterAtom(
|
||||
|
|
|
|||
|
|
@ -19,16 +19,17 @@ import io.element.android.libraries.designsystem.atomic.atoms.CounterAtom
|
|||
@Composable
|
||||
fun NavigationBarIcon(
|
||||
imageVector: ImageVector,
|
||||
count: Int,
|
||||
isCritical: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
count: Int = 0,
|
||||
isCritical: Boolean = false,
|
||||
) {
|
||||
Box {
|
||||
Box(modifier) {
|
||||
Icon(
|
||||
imageVector = imageVector,
|
||||
contentDescription = null,
|
||||
)
|
||||
CounterAtom(
|
||||
modifier = Modifier.Companion.offset(11.dp, (-11).dp),
|
||||
modifier = Modifier.offset(11.dp, (-11).dp),
|
||||
textStyle = ElementTheme.typography.fontBodyXsMedium,
|
||||
count = count,
|
||||
isCritical = isCritical,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,16 @@
|
|||
package io.element.android.libraries.designsystem.theme.components
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
|
||||
@Composable
|
||||
fun NavigationBarText(
|
||||
text: String,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Text(
|
||||
modifier = modifier,
|
||||
text = text,
|
||||
style = ElementTheme.typography.fontBodySmMedium,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue