0

Yet another question based on Chris Banes's cheesesquare demo.

After updating to the latest release of the library, I couldn't help notice an outstanding difference in the toolbar text size, when it is not collapsed.

Previous release, 22.2.0: design support library 22.2.0 Current release, 22.2.1: design support library 22.2.1

What's the reason for such an increase and most importantly how do I override it?

Is it easily achievable to set the desired size by using an xml attribute, or does a specific style need to be defined & used?

Note

Whichever the solution is, it shall not affect the size of the text when the toolbar is collapsed. Only when it is expanded, like in the above screenshots.

appoll
  • 2,910
  • 28
  • 40

1 Answers1

3

You need to define a custom style for CollapsingToolbarLayout:

<style name="CustomToolbar">
    <item name="android:textSize">@dimen/expanded_title_size</item>
</style>

And then apply it using setExpandedTitleTextAppearance method:

myCollapsingToolbar.setExpandedTitleTextAppearance(R.style.CustomToolbar);
Pavlo Zin
  • 762
  • 6
  • 25