Skip to content

Instantly share code, notes, and snippets.

@tfaki
Last active April 21, 2022 12:38
Show Gist options
  • Save tfaki/c41ebca8f5072aaa401b42d070f215ef to your computer and use it in GitHub Desktop.
Save tfaki/c41ebca8f5072aaa401b42d070f215ef to your computer and use it in GitHub Desktop.
CustomThreeItemsToolbar
@Composable
fun ScreenContent() {
Scaffold(
backgouroundColor = // yourcolor,
topBar = {
CustomToolbar()
},
content = {
// your content
}
)
}
@Composable
fun CustomToolbar() {
Box(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
) {
Image(
painter = painterResource(id = R.drawable.back_button),
contentDescription = "",
modifier = Modifier
.size(42.dp)
.align(Alignment.TopStart)
.clickable {
clickBack?.invoke()
}
)
Box(
modifier = Modifier
.align(Alignment.Center)
) {
Image(
painter = painterResource(id = logoRes),
contentDescription = "",
modifier = Modifier
.width(128.dp)
.height(75.dp)
.align(Alignment.TopCenter)
)
}
Image(
painter = painterResource(id = R.drawable.info_button),
contentDescription = "",
modifier = Modifier
.size(42.dp)
.align(Alignment.TopEnd)
.clickable {
clickInfo.invoke()
}
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment