react-native-navigation 7.30.3 → 7.30.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,9 +12,9 @@ def safeExtGetFallbackLowerBound(prop, fallback) {
12
12
  Math.max(safeExtGet(prop,fallback),fallback)
13
13
  }
14
14
 
15
- def DEFAULT_COMPILE_SDK_VERSION = 30
15
+ def DEFAULT_COMPILE_SDK_VERSION = 33
16
16
  def DEFAULT_MIN_SDK_VERSION = 21
17
- def DEFAULT_TARGET_SDK_VERSION = 30
17
+ def DEFAULT_TARGET_SDK_VERSION = 33
18
18
  def DEFAULT_KOTLIN_VERSION = "1.5.31"
19
19
  def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8'
20
20
  def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION)
@@ -22,7 +22,7 @@ def kotlinStdlib = safeExtGet('RNNKotlinStdlib',DEFAULT_KOTLIN_STDLIB )
22
22
  def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2')
23
23
  android {
24
24
  compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
25
-
25
+ buildToolsVersion = "33.0.0"
26
26
  defaultConfig {
27
27
  minSdkVersion safeExtGetFallbackLowerBound('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
28
28
  targetSdkVersion safeExtGetFallbackLowerBound('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
@@ -167,6 +167,27 @@ List reactNativeVersionComponents(rnPackageJsonFile) {
167
167
  return reactNativeVersion.tokenize('-')[0].tokenize('.')
168
168
  }
169
169
 
170
+ task installBuildToolsAndRenameD8IfNeeded {
171
+ def buildToolsVersion = android.getBuildToolsVersion()
172
+ def sdkDir = android.sdkDirectory
173
+ def buildToolsDir = new File(sdkDir, "/build-tools/" + buildToolsVersion)
174
+
175
+ if (!buildToolsDir.exists()) {
176
+ def command = sdkDir.absolutePath + "/cmdline-tools/latest/bin/sdkmanager build-tools;" + buildToolsVersion
177
+ command.execute().waitForProcessOutput(System.out, System.err)
178
+ }
179
+
180
+ def d8File = new File(buildToolsDir, "d8")
181
+ def dxFile = new File(buildToolsDir, "dx")
182
+ d8File.renameTo(dxFile)
183
+
184
+ def buildToolsLibDir = new File(buildToolsDir, "lib")
185
+ d8File = new File(buildToolsLibDir, "d8.jar")
186
+ dxFile = new File(buildToolsLibDir, "dx.jar")
187
+ d8File.renameTo(dxFile)
188
+ }
189
+ build.dependsOn installBuildToolsAndRenameD8IfNeeded
190
+
170
191
  dependencies {
171
192
 
172
193
  implementation "androidx.core:core-ktx:1.6.0"
@@ -1,5 +1,6 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativenavigation">
2
+ xmlns:tools="http://schemas.android.com/tools"
3
+ package="com.reactnativenavigation">
3
4
 
4
5
  <application>
5
6
  <activity
@@ -22,6 +22,7 @@ import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
22
22
  import com.reactnativenavigation.viewcontrollers.modal.ModalStack;
23
23
  import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
24
24
 
25
+ import androidx.activity.OnBackPressedCallback;
25
26
  import androidx.annotation.NonNull;
26
27
  import androidx.annotation.Nullable;
27
28
  import androidx.appcompat.app.AppCompatActivity;
@@ -47,6 +48,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
47
48
  );
48
49
  navigator.bindViews();
49
50
  getReactGateway().onActivityCreated(this);
51
+ setBackPressedCallback();
50
52
  }
51
53
 
52
54
  @Override
@@ -103,11 +105,6 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
103
105
  getReactGateway().onActivityResult(this, requestCode, resultCode, data);
104
106
  }
105
107
 
106
- @Override
107
- public void onBackPressed() {
108
- getReactGateway().onBackPressed();
109
- }
110
-
111
108
  @Override
112
109
  public boolean onKeyUp(final int keyCode, final KeyEvent event) {
113
110
  return getReactGateway().onKeyUp(this, keyCode) || super.onKeyUp(keyCode, event);
@@ -152,4 +149,14 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
152
149
  public void onCatalystInstanceDestroy() {
153
150
  runOnUiThread(() -> navigator.destroyViews());
154
151
  }
152
+
153
+ private void setBackPressedCallback() {
154
+ OnBackPressedCallback callback = new OnBackPressedCallback(true) {
155
+ @Override
156
+ public void handleOnBackPressed() {
157
+ getReactGateway().onBackPressed();
158
+ }
159
+ };
160
+ getOnBackPressedDispatcher().addCallback(this, callback);
161
+ }
155
162
  }
@@ -65,8 +65,9 @@ class Commands {
65
65
  }
66
66
  mergeOptions(componentId, options) {
67
67
  const input = (0, cloneDeep_1.default)(options);
68
- this.optionsProcessor.processOptions(CommandName_1.CommandName.MergeOptions, input);
69
68
  const component = this.store.getComponentInstance(componentId);
69
+ const componentProps = this.store.getPropsForId(componentId) || undefined;
70
+ this.optionsProcessor.processOptions(CommandName_1.CommandName.MergeOptions, input, componentProps);
70
71
  if (component && !component.isMounted)
71
72
  console.warn(`Navigation.mergeOptions was invoked on component with id: ${componentId} before it is mounted, this can cause UI issues and should be avoided.\n Use static options instead.`);
72
73
  this.nativeCommandsSender.mergeOptions(componentId, input);
@@ -73,9 +73,10 @@ export class Commands {
73
73
 
74
74
  public mergeOptions(componentId: string, options: Options) {
75
75
  const input = cloneDeep(options);
76
- this.optionsProcessor.processOptions(CommandName.MergeOptions, input);
77
76
 
78
77
  const component = this.store.getComponentInstance(componentId);
78
+ const componentProps = this.store.getPropsForId(componentId) || undefined;
79
+ this.optionsProcessor.processOptions(CommandName.MergeOptions, input, componentProps);
79
80
  if (component && !component.isMounted)
80
81
  console.warn(
81
82
  `Navigation.mergeOptions was invoked on component with id: ${componentId} before it is mounted, this can cause UI issues and should be avoided.\n Use static options instead.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.30.3",
3
+ "version": "7.30.5",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,