Change icon type
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package ru.fincode.core.ui.components
|
||||
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
|
||||
data class BottomBarItem(
|
||||
val key: String,
|
||||
val label: String,
|
||||
val icon: ImageVector,
|
||||
)
|
||||
@@ -1,17 +1,11 @@
|
||||
package ru.fincode.core.ui.components
|
||||
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
|
||||
data class BottomBarItem(
|
||||
val key: String,
|
||||
val label: String,
|
||||
val icon: Painter,
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun TsudeskBottomBar(
|
||||
@@ -21,19 +15,22 @@ fun TsudeskBottomBar(
|
||||
) {
|
||||
NavigationBar {
|
||||
items.forEach { item ->
|
||||
val selected = item.key == selectedKey
|
||||
|
||||
NavigationBarItem(
|
||||
selected = item.key == selectedKey,
|
||||
selected = selected,
|
||||
onClick = { onItemClick(item) },
|
||||
icon = {
|
||||
Icon(
|
||||
painter = item.icon,
|
||||
contentDescription = item.label
|
||||
imageVector = item.icon,
|
||||
contentDescription = item.label,
|
||||
tint = if (selected)
|
||||
MaterialTheme.colorScheme.primary
|
||||
else
|
||||
MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
},
|
||||
label = {
|
||||
Text(text = item.label)
|
||||
},
|
||||
alwaysShowLabel = true
|
||||
label = { Text(item.label) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user