Comments (7)
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?
from textjustify-android.
+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)));
from textjustify-android.
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 ?
from textjustify-android.
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.
from textjustify-android.
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;
from textjustify-android.
Refer to the experimental version posted on README.md
from textjustify-android.
Refer to updated version. It has been fixed along with major optimizations.
from textjustify-android.
Related Issues (20)
- How to set RTL for Arabic Text
- Extra space in AlertDialog
- max line limit HOT 1
- com.bluejamesbond.text.StringDocumentLayout$PlainDocumentException: Cannot fit word(s) into one line. Font size too large? HOT 2
- is Html text Support ?
- bug java.lang.IllegalArgumentException:
- How to change the text size? HOT 3
- java.lang.IndexOutOfBoundsException HOT 2
- Crash on Android 7.X
- DocumentViews in LinearLayout and EventListeners
- Background Color does not change with Spannables, please help.
- DocumentView has a problem with ExpandableListView
- RTL supprot for documentView_textFormat="plain"
- Broken on API 21 when change portrait to landscape positions
- Hyphenate license
- Image Span test does not work
- Report crash .onMeasure
- How to use android:ellipsize="end" attributes????
- bug: java.lang.IllegalArgumentException: width and height must be > 0
- onClick in Clickablespan is not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textjustify-android.