Introduce OffsetMapping for TextView TransformationMethod
This CL supports OffsetMapping internally for the TextView's TransformationMethod. It make it possible for TransformationMethod to alter the original text's length. It'll be mainly used for the insertion mode feature requested by stylus handwriting. This CL checked all index access to Layout from Editor, TextView and MovementMethod. And make sure they are aware of the text transformation. When there isn't a TransformationMethod or the TransformationMethod returns a text that's not an instance of OffsetMapping, the existing behavior is not impacted. The following classes will support a transformed text with OffsetMapping: - InsertionPointCursorController, SelectionModifierCursorController - InsertionHandleView, SelectionHandleView, HandleView - PinnedPopupWindow, EasyEditPopupWindow, SuggestionsPopupWindow - SelectionActionModeHelper The following parts don't support OffsetMapping, but instead will direclty return false/null or become no-op when OffsetMapping is used: - CursorAnchorInfoNotifier, CursorAnchorInfo - TextBoundsInfo - TextView HandwritingGesture - Selection move methods - LinkMovementMethod - BaseKeyListener Bug: 242089987 Test: atest DynamicLayoutTransformedTextTest Test: manually test Change-Id: I2ad2c2148353e69214efd9aae04a69a6367d0981
Loading
Please register or sign in to comment