Change android text inside list without using webview

I need to justify the text in Android without using WebView, because I use it inside the list, which creates a lot of problems due to skew when I scroll it in order, but when I return, webview keep the size of the latter, but change the text. This means that once I get text with a lot of space, it violates my ListView.

Is there a library for this?

+4
source share
3 answers

Unfortunately, you cannot justify the text in a TextView, but it seems that someone has found a solution by creating their own class / library.

Read the answers carefully here and here . Hope this helps!

+2
source

Well, it depends on how you want to justify the text.

you can use

android: layout_gravity = "center_vertical | right" // inside TextView

this will help the correct text as well

android:gravity="right" // inside <TextView> 

which will justify the text to the right. Similarly, the left value will remain valid.

Also, Textview will be indented by default to support other language fonts.
Now you can turn off this pad and enlarge the text again using

setIncludeFontPadding

+1
source

LIBRARY : https://github.com/bluejamesbond/TextJustify-Android

SETTINGS

 // Please visit Github for latest setup instructions. 

COMPARISON

Comparison.png

0
source

Source: https://habr.com/ru/post/1487491/


All Articles