Giter Club home page Giter Club logo

Comments (6)

1gravity avatar 1gravity commented on August 18, 2024

You can't insert images from a url at the moment. Feel free to submit a pull request for that.
Android does support only local images in ImageSpan, so you would have to download the image before inserting it into the text. You would extend the RTMediaFactoryImpl (or write a RTMediaFactory from scratch) to implement the download of an image in createImage(String) --> create a custom RTImage object that holds the reference to the local and the remote location. The exported HTML could use the remote image if that's preferred (the RTImage objects just needs to return the according path in getFilePath).

I'm not sure what you mean with "how to reference the link used in the actual text I would get from the editor"? Can you elaborate?
When the text is concerted to HTML it would create an img tag and call the getFilePath on the RTImage object. If your RTImage object returns the remote location of the image the HTML img tag would use that one (<img src="http://...).

from android-rteditor.

1gravity avatar 1gravity commented on August 18, 2024

You can use the FontManager.preLoadFonts(Context) method to asynchronously load the fonts when the app starts up. I call the method from my Application class.

Please don't create an issue with two questions. Makes it hard to close them off or keep them open if needed.

from android-rteditor.

johnernest02 avatar johnernest02 commented on August 18, 2024

Sorry and thanks for the tips. I'm considering implementing that as your library is the most complete rich editor I have seen. And quite fast when the fonts have been preloaded.

from android-rteditor.

johnernest02 avatar johnernest02 commented on August 18, 2024

Also yes I am referring do the remote location of the image.

from android-rteditor.

tigerjw avatar tigerjw commented on August 18, 2024

I was facing the same issue. My source was originally in HTML, and the image URLs were in the src attributes. I eventually figured out a way to parse out the URL and download the image then substitute the local image path for the URL in the src attribute, then passing the modifies version of HTML content into RTEditor. RTEditor successfully recognized the localized paths in the img src attributes and displayed the image this way. Perhaps this HTML approach would work as well?

from android-rteditor.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 18, 2024

Will this link be of any help:
https://medium.com/@rajeefmk/android-textview-and-image-loading-from-url-part-1-a7457846abb6
?

from android-rteditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.