Created
June 21, 2022 06:42
-
-
Save EmmanuelGuther/c18da4665f84b9d476f3e63f8877cbeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun TopAppBar(modifier: Modifier, backgroundColor: Color, onClickProfile: () -> Unit, onSearch: (String) -> Unit) { | |
TopAppBar(title = { | |
Row { | |
Text( | |
text = "AUDI APP STORE", | |
color = MaterialTheme.colors.onPrimary, | |
modifier = Modifier | |
.fillMaxWidth() | |
.height(60.dp) | |
.padding(16.dp), | |
textAlign = TextAlign.Center, | |
fontSize = 24.sp, | |
fontWeight = FontWeight.Bold | |
) | |
} | |
}, backgroundColor = backgroundColor, actions = { | |
CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.medium) { | |
IconButton(onClick = { /* TODO: Open search */ }) { | |
Icon( | |
imageVector = Icons.Filled.Search, contentDescription = "", tint = MaterialTheme.colors.onPrimary | |
) | |
} | |
IconButton(onClick = { onClickProfile.invoke() }) { | |
Icon( | |
imageVector = Icons.Default.AccountCircle, tint = MaterialTheme.colors.onPrimary, contentDescription = "" | |
) | |
} | |
} | |
}, modifier = modifier | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment