-
Notifications
You must be signed in to change notification settings - Fork 745
Open
Description
You are injecting modifier - Row(modifier), and then you call Modifier.width(8.dp), Modifier.padding(8.dp) etc... instead of modifier.width(8.dp), modifier.padding(8.dp) etc.
Is it a typo, or it was intentional? If so, what's the benefit and why injecting Modifier at all (in this case)?
@Composable
fun CraneTabBar(
modifier: Modifier = Modifier,
onMenuClicked: () -> Unit,
children: @Composable (Modifier) -> Unit
) {
Row(modifier) {
// Separate Row as the children shouldn't have the padding
Row(Modifier.padding(top = 8.dp)) {
Image(
modifier = Modifier
.padding(top = 8.dp)
.clickable(onClick = onMenuClicked),
painter = painterResource(id = R.drawable.ic_menu),
contentDescription = stringResource(id = R.string.cd_menu)
)
Spacer(Modifier.width(8.dp))
Image(
painter = painterResource(id = R.drawable.ic_crane_logo),
contentDescription = null
)
}
children(
Modifier
.weight(1f)
.align(Alignment.CenterVertically)
)
}
}
Metadata
Metadata
Assignees
Labels
No labels