Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text inside button too big autosize?

Tags:

java

android

The problem I am having is when changing localisation on the application the character length for some words is longer than the previous language therefore there are sizing issues with the buttons as they were initially made just for English.

English Locale Screenshot

enter image description here

Spanish Locale Screenshot

enter image description here

I know I am able to add android:maxLines="1" but this wouldn't solve my issue as the text is too large. I tried using a textview auto sizer for the text size but this hasn't solved the issue.

Does anyone have suggestions?

like image 868
Louis Ferraiolo Avatar asked Nov 08 '22 17:11

Louis Ferraiolo


1 Answers

Thanks to @AdeelTurk for providing this answer. I was able to use autofittextview with my buttons but it was complex here is an example of how I used it with a LinearLayout which usually don't work with this API.

like image 165
Louis Ferraiolo Avatar answered Nov 15 '22 11:11

Louis Ferraiolo