Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TM] Add spec for AccessibilityManager #24894

Closed
wants to merge 4 commits into from
Closed

[TM] Add spec for AccessibilityManager #24894

wants to merge 4 commits into from

Conversation

michalchudziak
Copy link
Contributor

Summary

Part of #24875

Changelog

[General] [Added] - Add TurboModule spec for AccessibilityManager

Test Plan

Run yarn flow on the root level

@michalchudziak michalchudziak added p: Callstack Partner: Callstack Partner labels May 16, 2019
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label May 16, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 16, 2019
@ericlewis ericlewis added the Flow label May 16, 2019
Copy link
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! There are some types missing from the android side of things however:

@ReactMethod
public void isReduceMotionEnabled(Callback successCallback) {
successCallback.invoke(mReduceMotionEnabled);
}
@ReactMethod
public void isTouchExplorationEnabled(Callback successCallback) {
successCallback.invoke(mTouchExplorationEnabled);
}

+removeListeners: (eventName: string, handler: Function) => void;
}

export default TurboModuleRegistry.getEnforcing<Spec>('AccessibilityManager');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the android side of this is named AccessibilityInfo use platform here to serve up either:

Platform.OS === 'ios' ? TurboModuleRegistry.getEnforcing<Spec>('AccessibilityManager') : TurboModuleRegistry.getEnforcing<Spec>('AccessibilityInfo')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're going to have a bit different API, that's why they live separate files.

I think:

Platform.OS === 'ios' ? TurboModuleRegistry.getEnforcing<Spec>('AccessibilityManager') : null

makes more sense

@michalchudziak
Copy link
Contributor Author

looks great! There are some types missing from the android side of things however:

@ReactMethod
public void isReduceMotionEnabled(Callback successCallback) {
successCallback.invoke(mReduceMotionEnabled);
}
@ReactMethod
public void isTouchExplorationEnabled(Callback successCallback) {
successCallback.invoke(mTouchExplorationEnabled);
}

I think this and AccessibilityInfo leads as separate modules. PR for Android one: #24891

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fkgozali has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor change for the conditional.

}

export default TurboModuleRegistry.getEnforcing<Spec>('AccessibilityManager');
export default (Platform.OS === 'ios'
? TurboModuleRegistry.getEnforcing<Spec>('AccessibilityManager')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this conditional, and just use get

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @michalchudziak in 71461cb.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 29, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
Summary:
Part of facebook#24875

## Changelog

[General] [Added] - Add TurboModule spec for AccessibilityManager
Pull Request resolved: facebook#24894

Reviewed By: rickhanlonii

Differential Revision: D15471243

Pulled By: fkgozali

fbshipit-source-id: 33f39d41d70da9380f29f2eb47e8c7682b323030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Flow Merged This PR has been merged. Native Module p: Callstack Partner: Callstack Partner Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants