ufo22940268 / android-justifiedtextview Goto Github PK
View Code? Open in Web Editor NEWandroid justified textview
android justified textview
Why is there some unknown amount of padding on the right side of the view? And is there any way to control it?
When using with RTL languages like Persian, the text disintegrates and becomes unreadable.
good lib though
repo主 走错了方向~ :)
On using this plugin, i found that if the last line of the passage contains very few letters, then the words itself gets spaced out giving a very poor UI experience. Justify should not apply on last line of any passage. This is basic feature.
In the source code of the JustfiyTextView.java, method drawScaledText() has an obvious mistake which causes the extra space on the right side while using justifiedTextview.
float scaleWidth = (mViewWidth - lineWidth) / line.length() -1;
this line calculates the default space of the textview on the right side and redistribute it among the chars.
so I think this line should be:
float scaleWidth = (mViewWidth - lineWidth) / (line.length() -1);
And there will not have any extra space on the right side anymore.
换成TextView之后是没有间距的,而切换成JustifiedTextView后,其顶部和右边有间距,怎么去除
android:scrollbarStyle="outsideOverlay"
not support for hindi, marathi language
SpannableString spannableString = new SpannableString(textView.getText().toString()); spannableString.setSpan(CharacterStyle.wrap(new BackgroundColorSpan(Color.YELLOW)), i, i + searchedText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); textView.setText(spannableString);
This is the code Which i've used to highlight yellow to any textview,
But this Library doesn't support Highlighting any Color over Specific TextView.
Any Help Would be Appreciated.
直接用了你的demo,直接在代码里设置的文本。
编译环境:eclipse adt,java 1.7
运行环境:Android 4.4.2
layout是这个:activity_text.xml
java文件是在这里的62行把text换了:TextActivity.java
text = "松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫,Genymotion for person use松岛枫";
Hi, i am using a linear layout, i am trying to set gravity bottom. But it isn't working. Can you help?
<me.biubiubiu.justifytext.library.JustifyTextView
android:text="@string/main_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textSize="18sp"
android:textColor="@color/background_floating_material_light"
/>
The second line end of sentence is handled nicely but the last line is stretched out.
I am trying to set max line 7 and applying eliipsize=end. But its not working and last line is cropping from the bottom side.
one:
when i use it to show chinese text,if last line only have several chinese it will insert some space untill the line is full,i set my font and textsize is 30
two:
if the text is english and chinese together in one line (i test is the third line)also will have the first problem
can you have a test ,thanks
Please Guru in the house, how can i load custom font with this library?
please pardon my question, am pretty new to programming
@ufo22940268 could you please add a license file to the project?
Process: com.zhongduomei.rrmj.society, PID: 23335
java.lang.ClassCastException: android.text.SpannedString cannot be cast to java.lang.String
at me.biubiubiu.justifytext.library.JustifyTextView.onDraw(JustifyTextView.java:34)
at android.view.View.draw(View.java:14493)
at android.view.View.getDisplayList(View.java:13390)
I would be grateful if you also would release a jar packaged artifact. Using apklibs is not comfortoble in eclipse. Actually i do not see the reason to package this as an AAR or APKLIB, since the library only contains classes, no Android resources.
When i add a Attribute in TextView Tag in xml
android:autoLink="web"
android:lickClickable="true"
android:linkColor="#0000ff"
this is not working and link color not be changed.
I want to change Link Color Change.
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.Layout.getLineCount()' on a null object reference..
It may not support ClickableSpan well, when the text has be justified, the ClickableSpan of each set may in confusion
如果可以检测文字只有一行不进行拉伸,还有就是最后一行不拉伸,可以搞吗?
我输入以下文字时出现第一行文字间距过大的问题:
YSL名字破会,广州,aldjadlaaadaadaslfalskfaldfaldfakdfaldfkaldfk面对就发了就阿瑟立刻就爱上
这个该怎么解决呢?
android:textIsSelectable="true" is not supported
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.