Android-Rich-text-Editor icon indicating copy to clipboard operation
Android-Rich-text-Editor copied to clipboard

Paste Clip data removes formatting

Open AKK-Tech opened this issue 4 years ago • 3 comments

Hi,

If I copied data from note or some other applications, I can't get the correct format when I paste it. Could you help me please if you have a time to explain?

Thanks.

AKK-Tech avatar Jan 20 '21 08:01 AKK-Tech

Hi,

When pasting content to the editor, the editor's onTextChanged method will be triggered, so I think you need to parse the pasted content from html into Spannable (using Html.fromHtml(html) ), then update the editor with the result.

I am not 100% sure about this but it worths a try.

Thanks.

chinalwb avatar Jan 20 '21 12:01 chinalwb

Thanks you for your reply sir. I'll try this.

AKK-Tech avatar Feb 03 '21 04:02 AKK-Tech

@AKK-Tech Hey, did you test it,? Succeeded?

easy-apps-2018 avatar Feb 04 '21 00:02 easy-apps-2018