From 69ec7d5dfd709aae6e3f35a6d48510b5b69f7836 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Tue, 4 Feb 2020 11:43:03 -0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Remove=20use=20of=20the=20deprecated?= =?UTF-8?q?=20AccessibilityNodeInfo=20boundsInPa=E2=80=A6=20(flutter/engin?= =?UTF-8?q?e#16355)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/flutter/view/AccessibilityViewEmbedder.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java index c4fbaa49e0..576dfabd82 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java @@ -197,11 +197,19 @@ final class AccessibilityViewEmbedder { 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);