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

feat: Add support for "Prefer Cross-Fade Transitions" into AccessibilityInfo #2

Closed
wants to merge 4 commits into from

Conversation

gabrieldonadel
Copy link
Owner

@gabrieldonadel gabrieldonadel commented Jan 21, 2022

Summary

This PR adds prefersCrossFadeTransitions to AccessibilityInfo in other to add support for "Prefer Cross-Fade Transitions", exposing the iOS settings option as proposed here https://github.com/react-native-community/discussions-and-proposals/issues/. 452.
I believe this would be especially helpful for solving facebook#31484

TODO

  • Submit react-native-web PR updating AccessibilityInfo documentation.

Changelog

[iOS] [Added] - Add support for "Prefer Cross-Fade Transitions" into AccessibilityInfo

Test Plan

On iOS 14+

  1. Access Settings > "General" > "Accessibility" > "Reduce Motion", enable "Reduce Motion" then enable "Prefer Cross-Fade Transitions".
  2. Open the RNTester app and navigate to the Accessibility page

Comment on lines 79 to 84
if (@available(iOS 14.0, *)) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(prefersCrossFadeTransitionsStatusDidChange:)
name:UIAccessibilityPrefersCrossFadeTransitionsStatusDidChangeNotification
object:nil];
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is not working as expected, UIAccessibilityPrefersCrossFadeTransitionsStatusDidChangeNotification never gets triggered. Best option might be just removing it for now and reading UIAccessibilityPrefersCrossFadeTransitions() directly

I've opened a question in Apple's Developer Forums reporting this issue https://developer.apple.com/forums/thread/699257

@gabrieldonadel gabrieldonadel self-assigned this Jan 27, 2022
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch from 2ec98a0 to be79058 Compare February 17, 2022 21:51
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch 2 times, most recently from 37e71c6 to 8127d3a Compare February 17, 2022 22:44
@gabrieldonadel gabrieldonadel changed the title (WIP) feat: Exposes iOS prefersCrossFadeTransitions feat: Add support for "Prefer Cross-Fade Transitions" into AccessibilityInfo Feb 17, 2022
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch from 8127d3a to 8bf2aa9 Compare February 17, 2022 23:32
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch from 8bf2aa9 to 71632b4 Compare August 13, 2022 21:18
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch from 4ee496c to ff3802d Compare August 20, 2022 19:07
@gabrieldonadel gabrieldonadel force-pushed the feat/add-prefer-crossfade-transitions branch from ff3802d to 5c81481 Compare August 20, 2022 19:14
@gabrieldonadel
Copy link
Owner Author

gabrieldonadel pushed a commit that referenced this pull request Sep 8, 2022
Summary: VirtualizedList would more gracefully handle out of range cells than VirtualizedList_EXPERIMENTAL, which treats it as an invariant violation. D39244112 (facebook@7aa203b) attempted to fix an issue where recalculation of cells around viewport can include out of range cells, but it is still showing up later. This change adds a bounds check to the remaining branch we control, and an assertion that `computeWindowedRenderLimits` is not returing something out of range to discover if that is the cause.

Reviewed By: yungsters

Differential Revision: D39267445

fbshipit-source-id: 64c99da28b5b01ef61784079b586e355f73764a1
gabrieldonadel pushed a commit that referenced this pull request Dec 20, 2023
Summary:
Pull Request resolved: facebook#41466

## Context
In open source, all apps use the same turbomodulemanager delegate (i.e: the default delegate).

This diff introduces the buck infra that makes the oss default delegate work for meta apps.

Concretely, we are going to make React Native use the same  delegate for **all** Meta apps.

Each Meta app will:
1. At build time, generate a unique TMProvider map
2. At app init time, initialize the default delegate with the TMProvider map.

## Implementation
**Step #1:** At build time, generate a unique TMProvider map

**Insight:** Buck genrules can accept, as input, the output of a buck query.

So, here's how we get this done:
1. Buck query (i.e: input to Genrule): Given the app's deps, query all the schemas in the app.
2. Genrule: Read the schemas to generate the TMProvider map. The TMProvider map will also contain **all** the app's C++ module codegen.

Concretely:
1. This diff introduces a macro: rn_codegen_appmodules(deps).
2. rn_codegen_appmodules(deps) generates appmodules.so, which contains the TMProvider map.

**Step #2:** At app init time, initialize the default delegate with the TMProvider map.

This is how we'll initialize the DefaultTurboModuleManagerDelegate:
1. DefaultTurboModuleManagerDelegate will load appmodules.so during init.
2. When loaded, appmodules.so will assign the code-generated TMProvider map to DefaultTurboModuleManagerDelegate.

## Impact
This should allow us to:
1. Get one step closer to getting rid of the `js1 build turbomodule-manager-delegates --target <app>` script
3. Remove the TurboModuleManagerDelegate from React Native's public API. (Because we use one delegate for all React Native apps in Meta and OSS)

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D50988397

fbshipit-source-id: 0ca5dec14e2dae89ec97f5d39a182c7937c5c7bf
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant