collapsingtoolbarlayout-subtitle

CircleCI Codecov Maven Central Android SDK
Figma Layers Pinterest

SubtitleCollapsingToolbarLayout

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.

Also…

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.

Download

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"
}

Usage

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"/>
Visit original content creator repository https://github.com/hanggrian/collapsingtoolbarlayout-subtitle

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *