GetScreenOffsetForGeoPoint
val GetScreenOffsetForGeoPoint: SemanticsPropertyKey<AccessibilityAction<(GeoPoint, CompletableDeferred<Offset?>) -> Boolean>>
Custom semantics property key to retrieve the screen offset for a given GeoPoint.
The associated action calculates the screen offset for the provided GeoPoint and sets the result Offset to the provided CompletableDeferred. If the provided GeoPoint is not visible on the screen, the offset is set to null.
Example usages:
@Test
fun testGetScreenOffsetForGeoPoint() {
val result = CompletableDeferred<Offset?>()
composeTestRule.onNodeWithTag("test_tag")
.performSemanticsAction(MapSemanticActions.GetScreenOffsetForGeoPoint) { action ->
action(GeoPoint(10.0, 10.0), result)
}
val effectiveOffset = runBlocking { result.await() }
}Content copied to clipboard
Return
true if the offset was successfully calculated and appended, false otherwise.