Async drawable doesn't show up if it's the only thing in the text view
See original GitHub issue- Markwon version: 4.2.1-SNAPSHOT + GlidePlugin
Async drawable doesn’t show up if it’s the only thing in the text view.
In the source code of the ReplacementSpan
there’s this suspicious javadoc
/**
* Returns the width of the span. Extending classes can set the height of the span by updating
* attributes of {@link android.graphics.Paint.FontMetricsInt}. If the span covers the whole
* text, and the height is not set,
* {@link #draw(Canvas, CharSequence, int, int, float, int, int, int, Paint)} will not be
* called for the span.
*/
public abstract int getSize(...)
And AsyncDrawable.initWithKnownDimensions(...)
is only called if AsyncDrawableSpan.draw(...)
of the parent span was called.
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
android - Image from async task never shows - Stack Overflow
Image from async task never shows ... I then tried to execute it in my code like this: ImageView im1 = (ImageView) findViewById(R.id.image); ......
Read more >TextView - Android Developers
Returns the extended top padding of the view, including both the top Drawable if any and any extra space to keep more than...
Read more >AsyncTask Tutorial With Example Android Studio [Step By Step]
This class will executes everything in doInBackground() method inside of other thread which doesn't have access to the GUI where all the views...
Read more >Kotlin and Android From Scratch Flashcards | Quizlet
Android studio kotlin beginner study guide Learn with flashcards, games, and more — for free.
Read more >Async Text Loading in Android with PrecomputedText
The TextView is one of the most common Views used across all the Android apps. It has very simple API to show the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce it, the fix is going to be in the next
4.3.0
version (and upcoming snapshot). The problem is thatGlide
is setting placeholder as a regular result.AsyncDrawable
receives the result, but as there are no canvas dimensions are available - there are no bounds available, thus span returns0
for the size. Please note that this is the case when there is exactly one image span in the markdown. If there is at least one other character/span, result would be as OKThis is on API 29, on the emulator