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
This commit is contained in:
Brett Lavalla
2018-10-27 23:34:21 -07:00
committed by Facebook Github Bot
parent a2c4c98feb
commit 21c0b3ad0e
2 changed files with 15 additions and 12 deletions

View File

@@ -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);

View File

@@ -545,14 +545,13 @@ export default class Layout extends FlipperPlugin<InspectorState> {
}
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) => {