material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[TabLayout] Ability to change the textAppearance based on the selection state of a Tab

Open kingargyle opened this issue 5 years ago • 4 comments

Is your feature request related to a problem? Please describe. We have a requirement that wants us to be able to change the textappearance of a tab based on it's selection state. We can change text color as it uses a state selector to manage this, but are unable to change the fonts, letter spacing, or text size by setting a selector.

The only way seems to be to do this programatically instead of being able to style these changes.

Describe the solution you'd like

it would be nice to have something like textAppearanceUnselected or something similar that would allow setting the textAppearance of a tab when it is in an unselected state. The regular textAppearance attribute can be used for the selected state or if there isn't an unselected attribute set.

Describe alternatives you've considered

We are considering listening to the tab selection events, and adjusting, but this may not necessarily work as well as it can't be driven by a Theme Overlay in which case the states could be changed based on business rules that cause the theme to change as well.

kingargyle avatar May 07 '20 12:05 kingargyle

+1

maxfie1d avatar Aug 07 '20 06:08 maxfie1d

That would be great to style unselected/selected tab's text appearances.

Is there any progress on this issue ?

okarakose avatar May 31 '21 08:05 okarakose

Just checking if we had any update on this?

darpal-ctl avatar Feb 11 '22 16:02 darpal-ctl

+1

SubrataSharma avatar Jun 21 '22 11:06 SubrataSharma