LargeTopAppBar is a material3 composable which has its limitations in terms of customizability, but is easy to use.
If you need something different you can simply create a composable function for the topBar parameter in your screen scaffold which will implement all of the features you need.
Scaffold (
topBar = { customTopBar() }
) { innerPadding ->
YourScreen(modifier = modifier.padding(innerPadding))
}
In case you've already used a Scaffold in your code, you can simply use a when() statement and pass the appropriate composable for each screen!
For the subtitle you could use a simple column with two Texts,
Column {
Text(text = "Title")
if ( /* topBar state condition */ )
Text(text = "Subtitle")
}
and for the rest of the app bar you can have a Row that includes all elements (depending on your bar), like so:
Row(
verticalAlignment = Alignment.CenterVertically
horizontalArrangement = Arrangement.SpaceBetween
) {
Row {
IconButton(...) // For the back button
// Your title and subtitle Column()
Column {
Text(text = "Title")
if ( /* topBar state condition */ )
Text(text = "Subtitle")
}
}
// Rest of the IconButtons if needed
Row {
IconButton(...)
IconButton(...)
}
}
Apologies as I am not well versed in Jetpack Compose animation, but it should be easy enough to implement as their library is very simple to use, and you can always check the docs on their website.
Material3 elements are still in alpha but using simple surface/box/etc... elements you can make most custom designs that are needed.
Hope I was able to help!