Skip to content

Commit

Permalink
[TopAppBar] Added collapsing subtitle.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 700042153
  • Loading branch information
pekingme authored and paulfthomas committed Dec 2, 2024
1 parent 0e9ab66 commit 73b577d
Show file tree
Hide file tree
Showing 9 changed files with 548 additions and 135 deletions.
39 changes: 22 additions & 17 deletions docs/components/TopAppBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,28 @@ Element | Attribute | Related method(s)

#### Title attributes

Element | Attribute | Related method(s) | Default value
-------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------
**`MaterialToolbar` title text** | `app:title` | `setTitle`<br>`getTitle` | `null`
**`MaterialToolbar` subtitle text** | `app:subtitle` | `setSubtitle`<br>`getSubtitle` | `null`
**`MaterialToolbar` title color** | `app:titleTextColor` | `setTitleTextColor` | `?attr/colorOnSurface`
**`MaterialToolbar` subtitle color** | `app:subtitleTextColor` | `setSubtitleTextColor` | `?attr/colorOnSurfaceVariant`
**`MaterialToolbar` title typography** | `app:titleTextAppearance` | `setTitleTextAppearance` | `?attr/textAppearanceTitleLarge`
**`MaterialToolbar` subtitle typography** | `app:subtitleTextAppearance` | `setSubtitleTextAppearance` | `?attr/textAppearanceTitleMedium`
**`MaterialToolbar` title centering** | `app:titleCentered` | `setTitleCentered` | `false`
**`MaterialToolbar` subtitle centering** | `app:subtitleCentered` | `setSubtitleCentered` | `false`
**`CollapsingToolbarLayout` collapsed title typography** | `app:collapsedTitleTextAppearance` | `setCollapsedTitleTextAppearance` | `?attr/textAppearanceTitleLarge`
**`CollapsingToolbarLayout` expanded title typography** | `app:expandedTitleTextAppearance` | `setExpandedTitleTextAppearance` | `?attr/textAppearanceHeadlineSmall` for Medium</br>`?attr/textAppearanceHeadlineMedium` for Large
**`CollapsingToolbarLayout` collapsed title color** | `android:textColor` (in `app:collapsedTitleTextAppearance`) or `app:collapsedTitleTextColor` | `setCollapsedTitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` expanded title color** | `android:textColor` (in `app:expandedTitleTextAppearance`) or `app:expandedTitleTextColor` | `setExpandedTitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` expanded title margins** | `app:expandedTitleMargin*` | `setExpandedTitleMargin*` | `16dp`
**`CollapsingToolbarLayout` title max lines** | `app:maxLines` | `setMaxLines`<br>`getMaxLines` | `1`
**`CollapsingToolbarLayout` title ellipsize** | `app:titleTextEllipsize` | `setTitleEllipsize`<br>`getTitleEllipsize` | `end`
Element | Attribute | Related method(s) | Default value
------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------
**`MaterialToolbar` title text** | `app:title` | `setTitle`<br>`getTitle` | `null`
**`MaterialToolbar` subtitle text** | `app:subtitle` | `setSubtitle`<br>`getSubtitle` | `null`
**`MaterialToolbar` title color** | `app:titleTextColor` | `setTitleTextColor` | `?attr/colorOnSurface`
**`MaterialToolbar` subtitle color** | `app:subtitleTextColor` | `setSubtitleTextColor` | `?attr/colorOnSurfaceVariant`
**`MaterialToolbar` title typography** | `app:titleTextAppearance` | `setTitleTextAppearance` | `?attr/textAppearanceTitleLarge`
**`MaterialToolbar` subtitle typography** | `app:subtitleTextAppearance` | `setSubtitleTextAppearance` | `?attr/textAppearanceTitleMedium`
**`MaterialToolbar` title centering** | `app:titleCentered` | `setTitleCentered` | `false`
**`MaterialToolbar` subtitle centering** | `app:subtitleCentered` | `setSubtitleCentered` | `false`
**`CollapsingToolbarLayout` collapsed title typography** | `app:collapsedTitleTextAppearance` | `setCollapsedTitleTextAppearance` | `?attr/textAppearanceTitleLarge`
**`CollapsingToolbarLayout` expanded title typography** | `app:expandedTitleTextAppearance` | `setExpandedTitleTextAppearance` | `?attr/textAppearanceHeadlineSmall` for Medium</br>`?attr/textAppearanceHeadlineMedium` for Large
**`CollapsingToolbarLayout` collapsed title color** | `android:textColor` (in `app:collapsedTitleTextAppearance`) or `app:collapsedTitleTextColor` | `setCollapsedTitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` expanded title color** | `android:textColor` (in `app:expandedTitleTextAppearance`) or `app:expandedTitleTextColor` | `setExpandedTitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` collapsed subtitle typography** | `app:collapsedSubtitleTextAppearance` | `setCollapsedSubtitleTextAppearance` | `?attr/textAppearanceTitleMedium`
**`CollapsingToolbarLayout` expanded subtitle typography** | `app:expandedSubtitleTextAppearance` | `setExpandedSubtitleTextAppearance` | `?attr/textAppearanceTitleLarge` for Medium</br>`?attr/textAppearanceHeadlineSmall` for Large
**`CollapsingToolbarLayout` collapsed subtitle color** | `android:textColor` (in `app:collapsedSubtitleTextAppearance`) or `app:collapsedSubtitleTextColor` | `setCollapsedSubtitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` expanded subtitle color** | `android:textColor` (in `app:expandedSubtitleTextAppearance`) or `app:expandedSubtitleTextColor` | `setExpandedSubtitleTextColor` | `?attr/colorOnSurface`
**`CollapsingToolbarLayout` expanded title margins** | `app:expandedTitleMargin*` | `setExpandedTitleMargin*` | `16dp`
**`CollapsingToolbarLayout` padding between expanded title and subtitle** | `app:expandedTitlePadding` | `setExpandedTitlePadding` | `0dp`
**`CollapsingToolbarLayout` title max lines** | `app:maxLines` | `setMaxLines`<br>`getMaxLines` | `1`
**`CollapsingToolbarLayout` title ellipsize** | `app:titleTextEllipsize` | `setTitleEllipsize`<br>`getTitleEllipsize` | `end`

#### Action items attributes

Expand Down
Loading

0 comments on commit 73b577d

Please sign in to comment.