Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c3d7b4e7 authored by Haoyu Zhang's avatar Haoyu Zhang
Browse files

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
parent f31bd18f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment