Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WIP: feat(text-base): allow to set image for span #8638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dosomder
Copy link
Contributor

PR Checklist

What is the current behavior?

You can not add images to formatted text even though iOS and Android provide this ability.

What is the new behavior?

You can add image to <Span> by using imageSrc.

It seems like on Android if using createFromPath it does not apply the file's resolution. That's why I also added imageHeight. On iOS this is optional as it applies the file's resolution by default.

Fixes/Implements/Closes #6366

@cla-bot cla-bot bot added the cla: yes label Jun 14, 2020
@dosomder dosomder force-pushed the add-image-support-to-span branch from 69b0b0c to d5310ae Compare June 14, 2020 16:20
@NathanWalker
Copy link
Contributor

🎉

@NathanWalker
Copy link
Contributor

@dosomder This is great. Possible to add to the e2e/ui-tests-app just a sample component that contains this span setup with an image (can use any remote sample image or one that exists in repo) to lock in this behavior?

@dosomder
Copy link
Contributor Author

Yes, I will try that. I am still working on the behavior of iOS. I want it to match the Android version. Also need to work on the delete (backspace) behavior.

Also this bug needs to be fixed #8620. It would be great if you could decide if the bug can be fixed.

By the way (at least on Android), this only allows to use local images. Still a very important feature in my opinion.

@NathanWalker
Copy link
Contributor

@dosomder Would you be available to collaborate over next couple weeks to wrap this up?

@dosomder
Copy link
Contributor Author

I have very limited time to work on this but still really interested to have it available in the official repo. The only thing I was thinking about is currently this solution loads the image from the filepath all the time.

If you are using an image many times, then this is very bad performance. It would be good if you could also pass e.g. on android a drawable directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ability to add inline image to TextView/ to Formatted String
2 participants