From 21c0b3ad0e388bb5d5d874237cd97a33ad1f24b2 Mon Sep 17 00:00:00 2001 From: Brett Lavalla Date: Sat, 27 Oct 2018 23:34:21 -0700 Subject: [PATCH] add litho accessibility rendering to Flipper accessibility mode [2/2] Summary: Completes D9667222 to allow force rendering of accessibility in litho when an accessibility service is not actually running. Reviewed By: ikenwoo Differential Revision: D9720987 fbshipit-source-id: 000a7413fcbe775a525ca3aca64443c3669cdf9e --- ...eLithoAccessibilityRenderExtensionCommand.java | 12 ++++++++---- src/plugins/layout/index.js | 15 +++++++-------- 2 files changed, 15 insertions(+), 12 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 9098dc2a7..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 @@ -1,5 +1,10 @@ -// Copyright 2004-present Facebook. All Rights Reserved. - +/* + * Copyright (c) 2004-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. + * + */ package com.facebook.flipper.plugins.litho; import android.view.View; @@ -70,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 0ccfd0ade..7fcfa1e13 100644 --- a/src/plugins/layout/index.js +++ b/src/plugins/layout/index.js @@ -545,14 +545,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) => {