I am trying to build a feature like WhatsApp tag person feature in group chat to my Android application. I have created an EditText which will highlight specified characters in the EditText whenever user tap on the person in the table row above as following screen. The original text from EditText will be replaced with HTML code in order to highlight in the EditText
<font color='#0659F4'>@</font><font color='#03A9F4'>displayName</font>
I am trying to implement the delete tag as whole (eg: @Tester Phone) when user delete any single character in the highlighted text of @Tester Phone at EditText.
I have tried to store start index and end index of each tag and listen to EditText cursor position changed event in order for me to decide which tag word to delete but yet I am still unable to achieve my expectation.
Appreciate if any suggestion or method for the implementation.
