Slide 42
Slide 42 text
˔͍ํΛ֮͑Δඞཁ͕͋Δ
˔͍ํΛڧ੍͢Δ͜ͱͰ͖ͳ͍
%4-ͰͷTMPU"1*ͷҙ
@Composable
fun AppBar(
title: @Composable ()
->
Unit,
navigationIcon: @Composable AppBarIconScope.()
->
Unit,
)
@Stable
class AppBarIconScope {
@Composable
fun BackButton(back: ()
- >
Unit, modifier: Modifier = Modifier) {
IconButton(onClick = back, modifier = modifier) {
Icon(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = null,
)
}
}
}
AppBar(
title = { Text("Title") },
navigationIcon = {
BackButton(back = {
/* .. . * /
})
},
)
AppBar(
title = { Text("Title") },
navigationIcon = {
IconButton(
/* . .. */
) {
Icon(
/* ... * /
)
}
},
)