From 50a5d231206daed92abdc214905531ec46a8b218 Mon Sep 17 00:00:00 2001 From: TappS Dir <47754916+TappSDir@users.noreply.github.com> Date: Wed, 23 Nov 2022 14:23:11 -0500 Subject: [PATCH 1/9] Update android --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index e09fb274..f5b1e04b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,5 +16,5 @@ android { } dependencies { - compile "com.facebook.react:react-native:+" + implementation "com.facebook.react:react-native:+" } From 62a8103f696e46d2f0ec1f0eb6233698a8a5fbb4 Mon Sep 17 00:00:00 2001 From: andresceballosm Date: Tue, 23 May 2023 09:02:00 -0500 Subject: [PATCH 2/9] update --- iOS/RCTOrientation/Orientation.m | 73 ++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/iOS/RCTOrientation/Orientation.m b/iOS/RCTOrientation/Orientation.m index 15e99271..5bb615d6 100644 --- a/iOS/RCTOrientation/Orientation.m +++ b/iOS/RCTOrientation/Orientation.m @@ -9,6 +9,8 @@ #import "RCTEventDispatcher.h" #endif +#import + @implementation Orientation @synthesize bridge = _bridge; @@ -20,6 +22,72 @@ + (UIInterfaceOrientationMask)getOrientation { return _orientation; } +-(UIViewController*) topViewControllerWithRootViewController:(id)rootViewController +{ + + if (rootViewController == nil) + { + return nil; + } + + if ([rootViewController isKindOfClass:[UITabBarController class]]) + { + UITabBarController *selectedTabBarController = rootViewController; + return [self topViewControllerWithRootViewController:selectedTabBarController.selectedViewController]; + } + else if ([rootViewController isKindOfClass:[UINavigationController class]]) + { + UINavigationController *selectedNavController = rootViewController; + return [self topViewControllerWithRootViewController:selectedNavController.visibleViewController]; + } + else + { + UIViewController *selectedViewController = rootViewController; + if (selectedViewController.presentedViewController != nil) + { + return [self topViewControllerWithRootViewController:selectedViewController.presentedViewController]; + } + } + return rootViewController; +} + +- (void)forceOrientation: (UIInterfaceOrientationMask)orientation { + [[NSOperationQueue mainQueue] addOperationWithBlock:^ { + if (@available(iOS 16, *)) { + NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects]; + UIWindowScene *scene = (UIWindowScene *)array[0]; + + for (UIWindow *window in scene.windows) { + UIViewController* vc = [self topViewControllerWithRootViewController:window.rootViewController]; + if (vc) { + [vc setNeedsUpdateOfSupportedInterfaceOrientations]; + } + } + + UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:orientation]; + [scene requestGeometryUpdateWithPreferences:geometryPreferences errorHandler:^(NSError * _Nonnull error) { + NSLog(@"Error while trying to lock orientation: %@", error); + }]; + + } else { + UIInterfaceOrientation o = UIInterfaceOrientationUnknown; + switch (orientation) { + case UIInterfaceOrientationMaskLandscapeLeft: + o = UIInterfaceOrientationLandscapeLeft; + break; + case UIInterfaceOrientationMaskLandscapeRight: + o = UIInterfaceOrientationLandscapeRight; + break; + case UIInterfaceOrientationMaskPortrait: + o = UIInterfaceOrientationPortrait; + break; + } + [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; + [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: o] forKey:@"orientation"]; + } + }]; +} + - (instancetype)init { if ((self = [super init])) { @@ -157,6 +225,7 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { NSLog(@"Locked to Portrait"); #endif [Orientation setOrientation:UIInterfaceOrientationMaskPortrait]; + [self forceOrientation: UIInterfaceOrientationMaskPortrait]; [[NSOperationQueue mainQueue] addOperationWithBlock:^ { [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@"orientation"]; @@ -173,12 +242,14 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { NSString *orientationStr = [self getSpecificOrientationStr:orientation]; if ([orientationStr isEqualToString:@"LANDSCAPE-LEFT"]) { [Orientation setOrientation:UIInterfaceOrientationMaskLandscape]; + [self forceOrientation: UIInterfaceOrientationMaskLandscapeRight]; [[NSOperationQueue mainQueue] addOperationWithBlock:^ { [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeRight] forKey:@"orientation"]; }]; } else { [Orientation setOrientation:UIInterfaceOrientationMaskLandscape]; + [self forceOrientation: UIInterfaceOrientationMaskLandscapeLeft]; [[NSOperationQueue mainQueue] addOperationWithBlock:^ { [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeLeft] forKey:@"orientation"]; @@ -192,6 +263,7 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { NSLog(@"Locked to Landscape Left"); #endif [Orientation setOrientation:UIInterfaceOrientationMaskLandscapeLeft]; + [self forceOrientation: UIInterfaceOrientationMaskLandscapeLeft]; [[NSOperationQueue mainQueue] addOperationWithBlock:^ { [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeLeft] forKey:@"orientation"]; @@ -205,6 +277,7 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { NSLog(@"Locked to Landscape Right"); #endif [Orientation setOrientation:UIInterfaceOrientationMaskLandscapeRight]; + [self forceOrientation: UIInterfaceOrientationMaskLandscapeRight]; [[NSOperationQueue mainQueue] addOperationWithBlock:^ { // this seems counter intuitive [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; From 4d6212761c2aa75873c99f26a9b9efb2b3831fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Ceballos=20M?= <30534988+andresceballosm@users.noreply.github.com> Date: Tue, 30 May 2023 11:28:33 -0500 Subject: [PATCH 3/9] Update Orientation.m --- iOS/RCTOrientation/Orientation.m | 60 ++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/iOS/RCTOrientation/Orientation.m b/iOS/RCTOrientation/Orientation.m index 5bb615d6..5b762dad 100644 --- a/iOS/RCTOrientation/Orientation.m +++ b/iOS/RCTOrientation/Orientation.m @@ -51,24 +51,49 @@ -(UIViewController*) topViewControllerWithRootViewController:(id)rootViewControl return rootViewController; } -- (void)forceOrientation: (UIInterfaceOrientationMask)orientation { - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { +- (void)forceOrientation:(UIInterfaceOrientationMask)orientation { + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ if (@available(iOS 16, *)) { NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects]; UIWindowScene *scene = (UIWindowScene *)array[0]; for (UIWindow *window in scene.windows) { - UIViewController* vc = [self topViewControllerWithRootViewController:window.rootViewController]; + UIViewController *vc = [self topViewControllerWithRootViewController:window.rootViewController]; if (vc) { - [vc setNeedsUpdateOfSupportedInterfaceOrientations]; + [vc setNeedsStatusBarAppearanceUpdate]; + [vc setNeedsUpdateOfHomeIndicatorAutoHidden]; } } - UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:orientation]; - [scene requestGeometryUpdateWithPreferences:geometryPreferences errorHandler:^(NSError * _Nonnull error) { - NSLog(@"Error while trying to lock orientation: %@", error); - }]; - + UIInterfaceOrientationMask supportedOrientations = UIInterfaceOrientationMaskAll; + UIInterfaceOrientation o = UIInterfaceOrientationUnknown; + + if ((orientation & UIInterfaceOrientationMaskPortrait) != 0) { + supportedOrientations |= UIInterfaceOrientationMaskPortrait; + o = UIInterfaceOrientationPortrait; + } + + if ((orientation & UIInterfaceOrientationMaskPortraitUpsideDown) != 0) { + supportedOrientations |= UIInterfaceOrientationMaskPortraitUpsideDown; + o = UIInterfaceOrientationPortraitUpsideDown; + } + + if ((orientation & UIInterfaceOrientationMaskLandscapeLeft) != 0) { + supportedOrientations |= UIInterfaceOrientationMaskLandscapeLeft; + o = UIInterfaceOrientationLandscapeLeft; + } + + if ((orientation & UIInterfaceOrientationMaskLandscapeRight) != 0) { + supportedOrientations |= UIInterfaceOrientationMaskLandscapeRight; + o = UIInterfaceOrientationLandscapeRight; + } + + if ((orientation & UIInterfaceOrientationMaskAllButUpsideDown) != 0) { + supportedOrientations |= UIInterfaceOrientationMaskAllButUpsideDown; + } + + [[UIDevice currentDevice] setValue:@(supportedOrientations) forKey:@"supportedInterfaceOrientations"]; + [[UIDevice currentDevice] setValue:@(o) forKey:@"orientation"]; } else { UIInterfaceOrientation o = UIInterfaceOrientationUnknown; switch (orientation) { @@ -81,13 +106,26 @@ - (void)forceOrientation: (UIInterfaceOrientationMask)orientation { case UIInterfaceOrientationMaskPortrait: o = UIInterfaceOrientationPortrait; break; + case UIInterfaceOrientationMaskPortraitUpsideDown: + o = UIInterfaceOrientationPortraitUpsideDown; + break; + case UIInterfaceOrientationMaskLandscape: + o = UIInterfaceOrientationLandscapeLeft; // Choose one of the landscape orientations + break; + case UIInterfaceOrientationMaskAllButUpsideDown: + o = UIInterfaceOrientationLandscapeLeft; // Choose one of the landscape orientations + break; + case UIInterfaceOrientationMaskAll: + o = UIInterfaceOrientationPortrait; // Choose one of the portrait orientations + break; } [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: o] forKey:@"orientation"]; + [[UIDevice currentDevice] setValue:@(o) forKey:@"orientation"]; } - }]; + }]; } + - (instancetype)init { if ((self = [super init])) { From 11a2004cceb7d8364f84e25d79387b8a4a1a9956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Ceballos=20M?= <30534988+andresceballosm@users.noreply.github.com> Date: Tue, 30 May 2023 14:43:54 -0500 Subject: [PATCH 4/9] Update Orientation.m --- iOS/RCTOrientation/Orientation.m | 81 +++++--------------------------- 1 file changed, 11 insertions(+), 70 deletions(-) diff --git a/iOS/RCTOrientation/Orientation.m b/iOS/RCTOrientation/Orientation.m index 5b762dad..e8327f07 100644 --- a/iOS/RCTOrientation/Orientation.m +++ b/iOS/RCTOrientation/Orientation.m @@ -51,49 +51,24 @@ -(UIViewController*) topViewControllerWithRootViewController:(id)rootViewControl return rootViewController; } -- (void)forceOrientation:(UIInterfaceOrientationMask)orientation { - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ +- (void)forceOrientation: (UIInterfaceOrientationMask)orientation { + [[NSOperationQueue mainQueue] addOperationWithBlock:^ { if (@available(iOS 16, *)) { NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects]; UIWindowScene *scene = (UIWindowScene *)array[0]; for (UIWindow *window in scene.windows) { - UIViewController *vc = [self topViewControllerWithRootViewController:window.rootViewController]; + UIViewController* vc = [self topViewControllerWithRootViewController:window.rootViewController]; if (vc) { - [vc setNeedsStatusBarAppearanceUpdate]; - [vc setNeedsUpdateOfHomeIndicatorAutoHidden]; + [vc setNeedsUpdateOfSupportedInterfaceOrientations]; } } - UIInterfaceOrientationMask supportedOrientations = UIInterfaceOrientationMaskAll; - UIInterfaceOrientation o = UIInterfaceOrientationUnknown; - - if ((orientation & UIInterfaceOrientationMaskPortrait) != 0) { - supportedOrientations |= UIInterfaceOrientationMaskPortrait; - o = UIInterfaceOrientationPortrait; - } - - if ((orientation & UIInterfaceOrientationMaskPortraitUpsideDown) != 0) { - supportedOrientations |= UIInterfaceOrientationMaskPortraitUpsideDown; - o = UIInterfaceOrientationPortraitUpsideDown; - } - - if ((orientation & UIInterfaceOrientationMaskLandscapeLeft) != 0) { - supportedOrientations |= UIInterfaceOrientationMaskLandscapeLeft; - o = UIInterfaceOrientationLandscapeLeft; - } - - if ((orientation & UIInterfaceOrientationMaskLandscapeRight) != 0) { - supportedOrientations |= UIInterfaceOrientationMaskLandscapeRight; - o = UIInterfaceOrientationLandscapeRight; - } - - if ((orientation & UIInterfaceOrientationMaskAllButUpsideDown) != 0) { - supportedOrientations |= UIInterfaceOrientationMaskAllButUpsideDown; - } - - [[UIDevice currentDevice] setValue:@(supportedOrientations) forKey:@"supportedInterfaceOrientations"]; - [[UIDevice currentDevice] setValue:@(o) forKey:@"orientation"]; + UIWindowSceneGeometryPreferencesIOS *geometryPreferences = [[UIWindowSceneGeometryPreferencesIOS alloc] initWithInterfaceOrientations:orientation]; + [scene requestGeometryUpdateWithPreferences:geometryPreferences errorHandler:^(NSError * _Nonnull error) { + NSLog(@"Error while trying to lock orientation: %@", error); + }]; + } else { UIInterfaceOrientation o = UIInterfaceOrientationUnknown; switch (orientation) { @@ -106,26 +81,13 @@ - (void)forceOrientation:(UIInterfaceOrientationMask)orientation { case UIInterfaceOrientationMaskPortrait: o = UIInterfaceOrientationPortrait; break; - case UIInterfaceOrientationMaskPortraitUpsideDown: - o = UIInterfaceOrientationPortraitUpsideDown; - break; - case UIInterfaceOrientationMaskLandscape: - o = UIInterfaceOrientationLandscapeLeft; // Choose one of the landscape orientations - break; - case UIInterfaceOrientationMaskAllButUpsideDown: - o = UIInterfaceOrientationLandscapeLeft; // Choose one of the landscape orientations - break; - case UIInterfaceOrientationMaskAll: - o = UIInterfaceOrientationPortrait; // Choose one of the portrait orientations - break; } [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:@(o) forKey:@"orientation"]; + [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: o] forKey:@"orientation"]; } - }]; + }]; } - - (instancetype)init { if ((self = [super init])) { @@ -264,10 +226,6 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { #endif [Orientation setOrientation:UIInterfaceOrientationMaskPortrait]; [self forceOrientation: UIInterfaceOrientationMaskPortrait]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@"orientation"]; - }]; } @@ -281,17 +239,9 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { if ([orientationStr isEqualToString:@"LANDSCAPE-LEFT"]) { [Orientation setOrientation:UIInterfaceOrientationMaskLandscape]; [self forceOrientation: UIInterfaceOrientationMaskLandscapeRight]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeRight] forKey:@"orientation"]; - }]; } else { [Orientation setOrientation:UIInterfaceOrientationMaskLandscape]; [self forceOrientation: UIInterfaceOrientationMaskLandscapeLeft]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeLeft] forKey:@"orientation"]; - }]; } } @@ -302,10 +252,6 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { #endif [Orientation setOrientation:UIInterfaceOrientationMaskLandscapeLeft]; [self forceOrientation: UIInterfaceOrientationMaskLandscapeLeft]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeLeft] forKey:@"orientation"]; - }]; } @@ -316,11 +262,6 @@ - (NSString *)getSpecificOrientationStr: (UIDeviceOrientation)orientation { #endif [Orientation setOrientation:UIInterfaceOrientationMaskLandscapeRight]; [self forceOrientation: UIInterfaceOrientationMaskLandscapeRight]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^ { - // this seems counter intuitive - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationLandscapeRight] forKey:@"orientation"]; - }]; } From c4cee01f178a67195a5b3caaa2d8f95a54e0a10e Mon Sep 17 00:00:00 2001 From: Josue Gonzalez Date: Mon, 18 Mar 2024 10:29:33 -0700 Subject: [PATCH 5/9] add version 3.1.5 --- android/build.gradle | 7 +++---- package.json | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index f5b1e04b..8bdfd87b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion 34 defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion 26 + targetSdkVersion 34 versionCode 1 versionName "1.0" ndk { diff --git a/package.json b/package.json index f1efa27f..894004dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-orientation", - "version": "3.1.3", + "version": "3.1.5", "description": "Listen to device orientation changes in React Native applications and programmatically set preferred orientations on a per screen basis", "main": "index.js", "scripts": { From 34c014500e5af39c8ca16250a05f5e38cbf0660f Mon Sep 17 00:00:00 2001 From: josueraquetsapp <157177736+josueraquetsapp@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:51:32 -0700 Subject: [PATCH 6/9] Update OrientationModule.java --- .../com/github/yamill/orientation/OrientationModule.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java index 85331aea..8c98ebb5 100644 --- a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java +++ b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java @@ -142,6 +142,7 @@ private String getOrientationString(int orientation) { } } + @RequiresApi(api = Build.VERSION_CODES.TIRAMISU) @Override public void onHostResume() { final Activity activity = getCurrentActivity(); @@ -150,7 +151,12 @@ public void onHostResume() { FLog.e(ReactConstants.TAG, "no activity to register receiver"); return; } - activity.registerReceiver(receiver, new IntentFilter("onConfigurationChanged")); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + activity.registerReceiver(receiver, new IntentFilter("onConfigurationChanged"), + Context.RECEIVER_NOT_EXPORTED); + } else { + activity.registerReceiver(receiver, new IntentFilter("onConfigurationChanged")); + } } @Override public void onHostPause() { From e27891ac39908e0409486f809854462504d988bb Mon Sep 17 00:00:00 2001 From: josueraquetsapp <157177736+josueraquetsapp@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:29:24 -0700 Subject: [PATCH 7/9] Update OrientationModule.java Validation UPSIDE_DOWN_CAKE --- .../java/com/github/yamill/orientation/OrientationModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java index 8c98ebb5..3d31448c 100644 --- a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java +++ b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java @@ -146,12 +146,12 @@ private String getOrientationString(int orientation) { @Override public void onHostResume() { final Activity activity = getCurrentActivity(); - if (activity == null) { FLog.e(ReactConstants.TAG, "no activity to register receiver"); return; } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { activity.registerReceiver(receiver, new IntentFilter("onConfigurationChanged"), Context.RECEIVER_NOT_EXPORTED); } else { From 72c536ba4ad5205991cb6ebd3631635d38184bcd Mon Sep 17 00:00:00 2001 From: josueraquetsapp <157177736+josueraquetsapp@users.noreply.github.com> Date: Thu, 21 Mar 2024 14:29:49 -0700 Subject: [PATCH 8/9] Update OrientationModule.java Change to TIRAMISU --- .../java/com/github/yamill/orientation/OrientationModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java index 3d31448c..0e3165eb 100644 --- a/android/src/main/java/com/github/yamill/orientation/OrientationModule.java +++ b/android/src/main/java/com/github/yamill/orientation/OrientationModule.java @@ -151,7 +151,7 @@ public void onHostResume() { return; } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { activity.registerReceiver(receiver, new IntentFilter("onConfigurationChanged"), Context.RECEIVER_NOT_EXPORTED); } else { From d7d1322250b3103467a0203bf35a2979167ec9c5 Mon Sep 17 00:00:00 2001 From: Josue Gonzalez Date: Wed, 10 Jul 2024 18:43:23 -0700 Subject: [PATCH 9/9] actualizacion de targetSdkVersion a la 34 --- demo/android/app/build.gradle | 15 +++++++-------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/demo/android/app/build.gradle b/demo/android/app/build.gradle index 8dfabae8..cf5a1853 100644 --- a/demo/android/app/build.gradle +++ b/demo/android/app/build.gradle @@ -90,13 +90,12 @@ def enableSeparateBuildPerCPUArchitecture = false def enableProguardInReleaseBuilds = false android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion 34 defaultConfig { applicationId "com.demo" - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion 26 + targetSdkVersion 34 versionCode 1 versionName "1.0" ndk { @@ -133,10 +132,10 @@ android { } dependencies { - compile project(':react-native-orientation') - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:+" // From node_modules + implementation project(':react-native-orientation') + implementation fileTree(dir: "libs", include: ["*.jar"]) + implementation "com.android.support:appcompat-v7:23.0.1" + implementation "com.facebook.react:react-native:+" // From node_modules } // Run this once to be able to run the application with BUCK diff --git a/demo/android/gradle/wrapper/gradle-wrapper.properties b/demo/android/gradle/wrapper/gradle-wrapper.properties index dbdc05d2..ffed3a25 100644 --- a/demo/android/gradle/wrapper/gradle-wrapper.properties +++ b/demo/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip