Closed ghost closed 9 years ago
solved it adding more padding to the bottom
TextViewEx.java:81 super.setPadding(left+10, top, right+10, bottom+80);
EDIT: Not solved, on bigger texts the problem returns... andy ideas?
+80 use real pixels, you have to use dp to be screen independant.
DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
super.setPadding((int)((left+(metrics.density * 10))), top, (int)(right+(metrics.density * 10)), (int) (bottom+(metrics.density * 40)));
Android match_parent doesn't actually realize that justified text occupies more height then regular text so the content is wrapped according to regular text alignment. Is there a way to tell android that the wrap content has to be made with the justified text method?
I solved it giving an actual layout_height that covers the entire justified text height but I wanted to know if it is the only solution or is it possible to tell the match_parent the actual text height putting some more code in the TextViewEx ?
All You Can Do Is while setting text textViewEx.setMinLines(value); And Value Can Be Calculated Through (yourText.length()/30) considering one line contain on average 30 characters.
Another Tweak Inside Your XML Put android:lineSpacingMultiplier="1.2" And Inside Your Extended TextView there is a temporary fix comment verticalOffset = horizontalFontOffset = getLineHeight(); at this line Put There verticalOffset = horizontalFontOffset = getLineHeight() - 8;
Refer to the experimental version posted on README.md
Refer to updated version. It has been fixed along with major optimizations.
When you put the TextViewEx inside a ScrollVIew the scroller doesnt show complete text, it leaves some behind, its like its not calculating the height properly.
This is the beggining of the textViewEx
This is the bottom, and the scroller its maxed out, and as you can see some of the text is missing.