Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

letterSpacing attribute not working in styles on Android Studio

I'd like to add letter spacing on my collapsingToolbar's title by adding android:letterSpacing=20 in:

<style name="CollapsedAppBar" parent="@android:style/TextAppearance">
<item name="android:letterSpacing">20</item>
<item name="android:textSize">90sp</item>
</style>

I'm calling my styles.xml from my activity class:

collapsingToolbar.setCollapsedTitleTextAppearance(R.style.CollapsedAppBar);

However, the textSize works but the letterSpacing attribute doesn't work, anyone can you help me about this?

like image 758
brettbrdls Avatar asked Dec 13 '25 09:12

brettbrdls


1 Answers

It looks like it does not support letter spacing :( CollapsingToolbarLayout delegates to CollapsingTextHelper which does not look for the android:letterSpacing attribute when parsing the TextAppearance:

https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/design/src/android/support/design/widget/CollapsingTextHelper.java#197

Please can you file a bug.

like image 50
crafty Avatar answered Dec 16 '25 11:12

crafty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!