Removed empty icon space from calls and contacts menu items
This commit is contained in:
@@ -147,6 +147,7 @@ object CustomElements {
|
|||||||
menuItems: List<MenuItem>,
|
menuItems: List<MenuItem>,
|
||||||
onItemClick: (String) -> Unit
|
onItemClick: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
|
val hasAnyIcon = menuItems.any { it.icon != null }
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = expanded,
|
expanded = expanded,
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
@@ -163,14 +164,19 @@ object CustomElements {
|
|||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
leadingIcon = {
|
leadingIcon = if (hasAnyIcon) {
|
||||||
|
{
|
||||||
if (menuItem.icon != null)
|
if (menuItem.icon != null)
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = menuItem.icon,
|
imageVector = menuItem.icon,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
},
|
else
|
||||||
|
Spacer(Modifier.size(24.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else null,
|
||||||
onClick = { onItemClick(menuItem.text) }
|
onClick = { onItemClick(menuItem.text) }
|
||||||
)
|
)
|
||||||
if (itemsIterator.hasNext())
|
if (itemsIterator.hasNext())
|
||||||
|
|||||||
Reference in New Issue
Block a user