Skip to content

Commit

Permalink
[TabLayout] Fix default tabTextAppearance
Browse files Browse the repository at this point in the history
Resolves #3085

GIT_ORIGIN_REV_ID=5c801bb6b6e9df227094106dedc5defa24b99077
PiperOrigin-RevId: 489517504
  • Loading branch information
pubiqq authored and drchen committed Nov 18, 2022
1 parent 090b988 commit cb1905d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/components/Tabs.md
Expand Up @@ -365,11 +365,11 @@ Element | Attribute | Related method(s)
------------------------- | --------------------------- | --------------------------------------------------------------- | -------------
**Text** | `android:text` | `setText`<br>`getText` | `null`
**Color** | `tabTextColor` | `setTabTextColors`<br>`getTabTextColors` | `colorOnSurfaceVariant` and `colorPrimary` (activated) (see all [states](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/tabs/res/color/m3_tabs_icon_color.xml))
**Typography** | `tabTextAppearance` | N/A | `?attr/textAppearanceLabelLarge`
**Active tab typography** | `selectedTabTextAppearance` | N/A | None; will use `tabTextAppearance` instead
**Typography** | `tabTextAppearance` | N/A | `?attr/textAppearanceTitleSmall`
**Active tab typography** | `tabSelectedTextAppearance` | N/A | None; will use `tabTextAppearance` instead
**Inline label** | `tabInlineLabel` | `setInlineLabel`<br>`setInlineLabelResource`<br>`isInlineLabel` | `false`

**Note:** When using `selectedTabTextAppearance`, you must have matching text
**Note:** When using `tabSelectedTextAppearance`, you must have matching text
attributes in `tabTextAppearance` to avoid unintended behavior.

### Tab item container attributes
Expand Down
2 changes: 1 addition & 1 deletion lib/java/com/google/android/material/tabs/TabLayout.java
Expand Up @@ -573,7 +573,7 @@ public TabLayout(@NonNull Context context, @Nullable AttributeSet attrs, int def
a.getDimensionPixelSize(R.styleable.TabLayout_tabPaddingBottom, tabPaddingBottom);

if (ThemeEnforcement.isMaterial3Theme(context)) {
defaultTabTextAppearance = R.attr.textAppearanceLabelLarge;
defaultTabTextAppearance = R.attr.textAppearanceTitleSmall;
} else {
defaultTabTextAppearance = R.attr.textAppearanceButton;
}
Expand Down

0 comments on commit cb1905d

Please sign in to comment.