




A carbon copy of CollapsingToolbarLayout
with subtitle support. During collapsed state, the subtitle would still appear
as Toolbar’s. There should be no learning curve because it works just like
CollapsingToolbarLayout
. Supports Material Design 3 styling.
But because this library uses restricted APIs and private resources from Material Components, there are a few caveats:
- Only safe to use with the same version of material components.
- Deceptive package name.
It is detabable if we even need this library. If the material guidelines says it’s ok to have a subtitle in toolbar layout, then they surely would’ve already implemented such feature. If it doesn’t say anything about subtitle (which is odds because Toolbar has it), then we probably shouldn’t use it out of respect to the guidelines.
This library’s versioning follows Material Components releases. Which in turn, follows AndroidX releases.
repositories {
mavenCentral()
google()
}
dependencies {
implementation "com.hendraanggrian.material:collapsingtoolbarlayout-subtitle:$version"
}
Treat SubtitleCollapsingToolbarLayout
just like a regular
CollapsingToolbarLayout
.
<com.google.android.material.appbar.SubtitleCollapsingToolbarLayout
style="?attr/subtitleCollapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

Leave a Reply