dankito / RichTextEditor

Rich text WYSIWYG editor for Android and JavaFX
Apache License 2.0
92 stars 36 forks source link

How to upload image and download image place in editor #10

Closed applehong5013 closed 5 years ago

applehong5013 commented 5 years ago

// only needed if you allow to automatically download remote images editor.setDownloadImageConfig(new DownloadImageConfig(DownloadImageUiSetting.AllowSelectDownloadFolderInCode, new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "downloaded_images"))); }

dankito commented 5 years ago

Excuse me, but I cannot figure out what the issue is. Could you please describe in more words what you are planning to do or what is not working?

If you like to insert an image: Add the InsertImageCommand to your toolbar (or use any of the provided toolbars).

If you also like to allow your users to download inserted images to local storage, add the lines you provided to your code.

Then in the insert image dialog (the one that appears after pressing the Insert Image command in the toolbar), insert a remote image address in 'Image path or web address'. The button 'Download to device' is then clickable:

screenshot_20181028-214422_with_arrows

applehong5013 commented 5 years ago

Thanks you reply :D I wanted to ask about how to upload an image from phone storage to the database(firebase)? Besides that, how I can populate the image from the database too? Can show me some sample code for that upload and populate image from database?