TextView Interworking

EditText extends a TextView , and all it does is set it for editing, so I read the source code for android.widget. TextView trying to figure out how EditText works.

I canโ€™t understand how the editing mechanism works, the line is saved in mText , when users click somewhere in the view, where it knows where it is in the line (cursor position), and then inserts / deletes the text while doing this. It seems I canโ€™t find the part of the code that handles this, insertion at a specific position. The relationship between the text on the display and mText. If you know how this works, I would appreciate an explanation.

+4
source share

Source: https://habr.com/ru/post/1494581/


All Articles