Skip to content

Commit

Permalink
Revert "Remove use of the deprecated AccessibilityNodeInfo boundsInPa… (
Browse files Browse the repository at this point in the history
  • Loading branch information
amirh authored Feb 4, 2020
1 parent 7ca44d3 commit 7f6149c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,19 @@ private void cacheVirtualIdMappings(@NonNull View embeddedView, int originId, in
flutterIdToOrigin.put(flutterId, origin);
}

// Supressing deprecation warning for AccessibilityNodeInfo#getBoundsinParent and
// AccessibilityNodeInfo#getBoundsinParent as we are copying the platform view's
// accessibility node and we should not lose any available bounds information.
@SuppressWarnings("deprecation")
private void setFlutterNodesTranslateBounds(
@NonNull AccessibilityNodeInfo originNode,
@NonNull Rect displayBounds,
@NonNull AccessibilityNodeInfo resultNode
) {
Rect boundsInParent = new Rect();
originNode.getBoundsInParent(boundsInParent);
resultNode.setBoundsInParent(boundsInParent);

Rect boundsInScreen = new Rect();
originNode.getBoundsInScreen(boundsInScreen);
boundsInScreen.offset(displayBounds.left, displayBounds.top);
Expand Down

0 comments on commit 7f6149c

Please sign in to comment.