send highlightID in json payload send to native app

This commit is contained in:
Satindar Dhillon
2022-11-16 12:49:46 -08:00
parent a0aeb79686
commit f13c3551fa
2 changed files with 3 additions and 1 deletions

View File

@ -162,11 +162,12 @@ fun WebReader(
}
val javascriptInterface = AndroidWebKitMessenger { actionID, json ->
Log.d("wv", "received actionID from Android: $actionID, $json")
when (actionID) {
"existingHighlightTap" -> {
isExistingHighlightSelected = true
actionTapCoordinates = Gson().fromJson(json, ActionTapCoordinates::class.java)
Log.d("Loggo", "receive existing highlight tap action: $actionTapCoordinates")
Log.d("wv", "receive existing highlight tap action: $actionTapCoordinates")
startActionMode(null, ActionMode.TYPE_PRIMARY)
}
else -> {

View File

@ -289,6 +289,7 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element {
rectY: rect.y,
rectWidth: rect.width,
rectHeight: rect.height,
highlightID: highlight.id,
}
window?.webkit?.messageHandlers.viewerAction?.postMessage({
actionID: 'showMenu',