From 4954d018d02d9684f69073b07e103fe611fb41a4 Mon Sep 17 00:00:00 2001 From: Brett Lavalla Date: Sat, 10 Nov 2018 00:03:55 -0800 Subject: [PATCH] Add litho accessibility rendering to Flipper accessibility mode Summary: This is a re-do of D9720987. Now that the Litho version has been bumped to 20 in D12838684, this diff can land safely. Reviewed By: danielbuechele Differential Revision: D12969979 fbshipit-source-id: b12d14e3b292d8cd110967f84f770f3725a800de --- ...eLithoAccessibilityRenderExtensionCommand.java | 3 +-- src/plugins/layout/index.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/android/src/main/java/com/facebook/flipper/plugins/litho/GenerateLithoAccessibilityRenderExtensionCommand.java b/android/src/main/java/com/facebook/flipper/plugins/litho/GenerateLithoAccessibilityRenderExtensionCommand.java index 0df3920e3..e511246db 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/litho/GenerateLithoAccessibilityRenderExtensionCommand.java +++ b/android/src/main/java/com/facebook/flipper/plugins/litho/GenerateLithoAccessibilityRenderExtensionCommand.java @@ -75,8 +75,7 @@ public final class GenerateLithoAccessibilityRenderExtensionCommand while (!lithoViewSearchStack.isEmpty()) { ViewGroup v = lithoViewSearchStack.pop(); if (v instanceof LithoView) { - // TODO: uncomment once Litho open source updates - // ((LithoView) v).rerenderForAccessibility(forceLithoAXRender); + ((LithoView) v).rerenderForAccessibility(forceLithoAXRender); } else { for (int i = 0; i < v.getChildCount(); i++) { View child = v.getChildAt(i); diff --git a/src/plugins/layout/index.js b/src/plugins/layout/index.js index e215a5db8..67483b4d2 100644 --- a/src/plugins/layout/index.js +++ b/src/plugins/layout/index.js @@ -548,14 +548,13 @@ export default class Layout extends FlipperPlugin { } initAX() { - // TODO: uncomment once Litho open source updates - // this.client - // .call('shouldShowLithoAccessibilitySettings') - // .then((showLithoAccessibilitySettings: boolean) => { - // this.setState({ - // showLithoAccessibilitySettings, - // }); - // }); + this.client + .call('shouldShowLithoAccessibilitySettings') + .then((showLithoAccessibilitySettings: boolean) => { + this.setState({ + showLithoAccessibilitySettings, + }); + }); performance.mark('InitAXRoot'); this.client.call('getAXRoot').then((element: Element) => {