From cb1905dbff746ffce992ce60a8af7999ced89062 Mon Sep 17 00:00:00 2001 From: pubiqq Date: Fri, 18 Nov 2022 14:08:13 -0500 Subject: [PATCH] [TabLayout] Fix default tabTextAppearance Resolves https://github.com/material-components/material-components-android/pull/3085 GIT_ORIGIN_REV_ID=5c801bb6b6e9df227094106dedc5defa24b99077 PiperOrigin-RevId: 489517504 --- docs/components/Tabs.md | 6 +++--- lib/java/com/google/android/material/tabs/TabLayout.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/components/Tabs.md b/docs/components/Tabs.md index a9986e457ca..55fa43f8a95 100644 --- a/docs/components/Tabs.md +++ b/docs/components/Tabs.md @@ -365,11 +365,11 @@ Element | Attribute | Related method(s) ------------------------- | --------------------------- | --------------------------------------------------------------- | ------------- **Text** | `android:text` | `setText`
`getText` | `null` **Color** | `tabTextColor` | `setTabTextColors`
`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`
`setInlineLabelResource`
`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 diff --git a/lib/java/com/google/android/material/tabs/TabLayout.java b/lib/java/com/google/android/material/tabs/TabLayout.java index ad2130c3b19..fe8d7985847 100644 --- a/lib/java/com/google/android/material/tabs/TabLayout.java +++ b/lib/java/com/google/android/material/tabs/TabLayout.java @@ -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; }