Comments (21)
@xbroak Just call documentView.requestLayout()
. This was done in order to optimize when to initiate justification. In other words, you can do batch changes to the settings and then just call requestLayout
or invalidate
depending on whether you changed any metric affecting features or just some basic color settings respectively.
from textjustify-android.
I tried that! Nothing.
------ Original Message ------
From: "Mathew Kurian" [email protected]
To: "bluejamesbond/TextJustify-Android"
[email protected]
Cc: "Joe Scott" [email protected]
Sent: 30/01/2015 18:38:50
Subject: Re: [TextJustify-Android] Setting text with spannable, wont
update unless i click and drag on textview (#61)
@xbroak Just call documentView.requestLayout().
—
Reply to this email directly or view it on GitHub.
from textjustify-android.
Which version are you running? And can you paste some more of your code here i.e. your layout and activity (portions relating to this lib).
from textjustify-android.
Latest
------ Original Message ------
From: "Mathew Kurian" [email protected]
To: "bluejamesbond/TextJustify-Android"
[email protected]
Cc: "Joe Scott" [email protected]
Sent: 30/01/2015 18:41:27
Subject: Re: [TextJustify-Android] Setting text with spannable, wont
update unless i click and drag on textview (#61)
Which version?
—
Sent from MailboxOn Fri, Jan 30, 2015 at 12:40 PM, Joe Scott [email protected]
wrote:I tried that! Nothing.
------ Original Message ------
From: "Mathew Kurian" [email protected]
To: "bluejamesbond/TextJustify-Android"
[email protected]
Cc: "Joe Scott" [email protected]
Sent: 30/01/2015 18:38:50
Subject: Re: [TextJustify-Android] Setting text with spannable, wont
update unless i click and drag on textview (#61)@xbroak Just call documentView.requestLayout().
—
Reply to this email directly or view it on GitHub.
Reply to this email directly or view it on GitHub:
#61 (comment)
—
Reply to this email directly or view it on GitHub.
from textjustify-android.
Weird, i am seeing different responses in the email notifications! how strange.
compile 'com.github.bluejamesbond:textjustify-android:2.0.8'
That's the version, just fyi
from textjustify-android.
The only code is the documentview example on the wiki and the code i've pasted in my original post :)
from textjustify-android.
I think I know the issue. I don't have a computer near me. Try calling documentView.invalidateCache()
right after you set the updated text. So, it should look like this.
documentView.setText(newText);
documentView.invalidateCache();
documentView.requestLayout();
from textjustify-android.
Hi, sorry to respond so late, it seems that 'invalidateCache' is not a defined method/public
from textjustify-android.
Just tried using destroyCache(); in its place, which does actually make it update! just only the first time, when attempting to set the text a second time, it reverts back to the old behaviour!
from textjustify-android.
Well. It seems that it's as simple as calling 'invalidate' after setting the text. Seems to update as desired now, very peculiar though?
from textjustify-android.
@xbroak You don't need to do any of that anymore. Just set the text and it should change. Use version 2.0.9
from textjustify-android.
I'm afraid, it is not fixed!
from textjustify-android.
Seems to be doing it all over again for some reason, my fix just stopped working.
When highlighting text, it highlights the wrong words! ( even those logging the actual text + html shows the correct setup) and the only way to fix it is to do the familiar drag to update)
from textjustify-android.
Which version are you using?
from textjustify-android.
(Just updated the comment above)
I'm using the latest (2.1.0)
from textjustify-android.
I think you should revert back to tge last working version I'll notify you when I can confirm the sokution.
from textjustify-android.
The weird thing is, even moving back to the old version seems to be doing it now. I literally changed nothing.
from textjustify-android.
I have a feeling i was just getting lucky before and the problem only happens at random.
from textjustify-android.
If you can post a video. That would be the best!
—
Sent from Mailbox
On Wed, Feb 4, 2015 at 2:24 PM, Joe Scott [email protected]
wrote:
I have a feeling i was just getting lucky before and the problem only happens at random.
Reply to this email directly or view it on GitHub:
#61 (comment)
from textjustify-android.
@xbroak you should try to call invalidate()
on your DocumentView, I've got almost same problem and this helped. Somehow requestLayout()
doesn't force to redraw view
from textjustify-android.
Is there any fix for this yet I am trying to change the inline background for the DocumentView
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.