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

Feature isLocked #1

Merged
merged 16 commits into from
May 24, 2024
Merged

Feature isLocked #1

merged 16 commits into from
May 24, 2024

Conversation

gladiuscode
Copy link
Owner

This PR implements a new method called isLocked and available for iOS and Android.
It is a synchronous method that returns the current interface orientation status: locked or unlocked.

The JS side exposes the following 3 APIs to access it:

  1. RNOrientationDirector.isLocked: we can call this method to get the current status;
  2. RNOrientationDiretor.listenForLockChanges: we can call this method to listen for each status change;
  3. useIsInterfaceOrientationLocked: we can use this hook to listen to each status change and obtain a state;

@gladiuscode gladiuscode self-assigned this May 23, 2024
@gladiuscode gladiuscode added the enhancement New feature or request label May 23, 2024
@gladiuscode
Copy link
Owner Author

It should automatically set isLocked to true when devs set either Portrait or Landscape as the only valid orientation for the activity / window.
It needs the implementation for this feature too.

@gladiuscode
Copy link
Owner Author

For some reason the iOS builds fails because it launches Codegen even tho the build itself is set for the old architecture.
I've tried to reproduce it locally, without success.

I need to investigate why it does that, maybe by opening an issue in callstack's repository.

@gladiuscode gladiuscode merged commit a5149e0 into main May 24, 2024
5 checks passed
@gladiuscode gladiuscode deleted the feature/is_locked branch May 24, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant