Created
November 3, 2023 14:36
-
-
Save plateaukao/921ee2f55b66ea3cc29df60ac7843ea2 to your computer and use it in GitHub Desktop.
sequence diagram of android webview link text selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@startuml | |
autonumber | |
actor User as user | |
participant Activity as a | |
participant WebView as w | |
w -> w: onPageFinished()\naddSelectionChangeListener() | |
note over w | |
Javascript on selectionchange listener: | |
2. find and return the position of (start and) | |
end position of the selection range | |
3. updateSelectionRect() to Activity | |
The Rect is used to place context menu | |
according to selection range. | |
end note | |
user -> a : long click on link | |
a --> user : show actionMode menu | |
user -> a : trigger text selection | |
activate w | |
a -> w : selectLinkText() | |
w -> w : JS: select text of current node | |
w -> a : simulateLongClick() | |
a --> user: show text selection context menu | |
w -> w : add back href attribute | |
deactivate w | |
@enduml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment