react-native-navigation 7.25.3 → 7.25.4-snapshot.582

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.
@@ -18,6 +18,7 @@ export const NavigationButton = class extends Component<ButtonProps> {
18
18
  testID={button.testID}
19
19
  key={button.id}
20
20
  title={button.text || ''}
21
+ disabled={button.enabled === false}
21
22
  onPress={() =>
22
23
  button.enabled !== false &&
23
24
  events.invokeNavigationButtonPressed({
@@ -59,7 +59,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
59
59
  @Override
60
60
  public void onHostPause() {
61
61
  super.onHostPause();
62
- navigator().onHostPause();
62
+ UiUtils.runOnMainThread(() -> navigator().onHostPause());
63
63
  }
64
64
 
65
65
  @Override
@@ -72,7 +72,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
72
72
  navigator().getChildRegistry(),
73
73
  ((NavigationApplication) activity().getApplication()).getExternalComponents()
74
74
  );
75
- navigator().onHostResume();
75
+ UiUtils.runOnMainThread(() -> navigator().onHostResume());
76
76
  }
77
77
  });
78
78
  }
@@ -4,6 +4,7 @@ import android.app.Activity;
4
4
  import android.content.res.Configuration;
5
5
  import android.view.View;
6
6
  import android.view.ViewGroup;
7
+ import android.view.WindowManager;
7
8
 
8
9
  import com.reactnativenavigation.options.OverlayAttachOptions;
9
10
  import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
@@ -21,10 +22,13 @@ import androidx.annotation.NonNull;
21
22
  import androidx.annotation.Nullable;
22
23
  import androidx.core.graphics.Insets;
23
24
  import androidx.core.view.ViewCompat;
25
+ import androidx.core.view.ViewKt;
24
26
  import androidx.core.view.WindowInsetsCompat;
25
27
 
26
28
  import static com.reactnativenavigation.utils.ObjectUtils.perform;
27
29
 
30
+ import kotlin.Unit;
31
+
28
32
  public class ComponentViewController extends ChildController<ComponentLayout> {
29
33
  private final String componentName;
30
34
  private final ComponentPresenter presenter;
@@ -156,8 +160,10 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
156
160
  ViewController<?> viewController = findController(view);
157
161
  if (viewController == null || viewController.getView() == null || ignoreInsets) return insets;
158
162
  final Options currentOptions = resolveCurrentOptions(presenter.defaultOptions);
159
-
160
- final int keyboardBottomInset = currentOptions.layout.adjustResize.get(true) ? insets.getInsets(WindowInsetsCompat.Type.ime()).bottom : 0;
163
+ int mode = getActivity().getWindow().getAttributes().softInputMode;
164
+ boolean adjustNothing = (mode & WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING) ==WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING ;
165
+ final int keyboardBottomInset = currentOptions.layout.adjustResize.get(true) &&!adjustNothing ?
166
+ insets.getInsets(WindowInsetsCompat.Type.ime()).bottom : 0;
161
167
  final Insets systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars());
162
168
  final int visibleNavBar = currentOptions.navigationBar.isVisible.isTrueOrUndefined() ? 1 : 0;
163
169
  final int controllerBottomInset = currentOptions.bottomTabsOptions.isHiddenOrDrawBehind() ? 0 : getBottomInset();
@@ -167,8 +173,10 @@ public class ComponentViewController extends ChildController<ComponentLayout> {
167
173
  systemBarsInsets.right,
168
174
  Math.max(0, Math.max(visibleNavBar * systemBarsInsets.bottom, keyboardBottomInset) - controllerBottomInset))
169
175
  ).build();
170
-
171
- ViewCompat.onApplyWindowInsets(viewController.getView(), finalInsets);
176
+ ViewKt.doOnLayout(viewController.getView(), (v) -> {
177
+ ViewCompat.onApplyWindowInsets(viewController.getView(), finalInsets);
178
+ return Unit.INSTANCE;
179
+ });
172
180
  return insets;
173
181
  }
174
182
 
@@ -12,7 +12,7 @@ const NavigationButton = class extends react_1.Component {
12
12
  const { button, componentId } = this.props;
13
13
  if (button.component)
14
14
  return this.renderButtonComponent();
15
- return (react_1.default.createElement(react_native_1.Button, { testID: button.testID, key: button.id, title: button.text || '', onPress: () => button.enabled !== false &&
15
+ return (react_1.default.createElement(react_native_1.Button, { testID: button.testID, key: button.id, title: button.text || '', disabled: button.enabled === false, onPress: () => button.enabled !== false &&
16
16
  EventsStore_1.events.invokeNavigationButtonPressed({
17
17
  buttonId: button.id,
18
18
  componentId,
@@ -2,6 +2,20 @@
2
2
 
3
3
  @implementation RNNComponentRootView
4
4
 
5
+ - (instancetype)initWithBridge:(RCTBridge *)bridge
6
+ moduleName:(NSString *)moduleName
7
+ initialProperties:(NSDictionary *)initialProperties
8
+ eventEmitter:(RNNEventEmitter *)eventEmitter
9
+ reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
10
+ self = [super initWithBridge:bridge
11
+ moduleName:moduleName
12
+ initialProperties:initialProperties
13
+ eventEmitter:eventEmitter
14
+ reactViewReadyBlock:reactViewReadyBlock];
15
+ [bridge.uiManager setAvailableSize:UIScreen.mainScreen.bounds.size forRootView:self];
16
+ return self;
17
+ }
18
+
5
19
  - (NSString *)componentType {
6
20
  return ComponentTypeScreen;
7
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.25.3",
3
+ "version": "7.25.4-snapshot.582",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,