compose-rich-editor
compose-rich-editor copied to clipboard
Add images support
- Add images support
Can you give me some ideas how to add images?
For now it's not possible to display images in the rich editor, so as a start we are going to display images as string, similar to github editor for example:
Then in the Rich Text, which is just a representation without editing options we should see the image, the image is going to be passed and displayed as an ImageBitmap
then we could implement on top of that painter resource or any other source of images like a url or whatever
I could be wrong and haven't tried it yet but shouldn't it be possible to show a image as inline content of the annotated string in TextFieldValue inside the TextField? Or did you just mean that you won't support images on the textfield for now? 🙂
Well AFAIK showing images as inline content of the annotated string is only possible with normal Text, because TextField doesn't support inline content. I had a conversation with a developer working on the new compose text api and I told him about this limitation. So for know it's a limitation from Compose until they improve it or we found a workaround.
Okay weird that they use annotated string but doesn't support all of its features... Hope the new TextField APIs will support this later on, waiting for better support of keeping the TextField and cursor above the keyboard when the text is long when that one is released.
Regarding the implementation of Textfield add image, I have some ideas. I can use Image in the position of the picture, and then use Textfield in other areas, like this Column { TextField image TextField ... }
Yes this could work but the user experience when you try removing text and you reach the image could be bad, I'm thinking also of reserving a place for the image in the TextField then position the Image there.
Box {
TextField()
Image()
}
@MohamedRejeb Is this still in the works?
Seems like a official Compose solution is still not in sight, see: https://issuetracker.google.com/issues/157506938
Image support will be added to the RichText
soon (Not the editor)
For the editor, we're still waiting for Compose to add inline element support in TextField.
Image support will be added to the
RichText
soon (Not the editor) For the editor, we're still waiting for Compose to add inline element support in TextField.
@MohamedRejeb Any update on this?
any progress
This feature is almost there, hopefully it will be available in the next release after 1~2 weeks.