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

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.
@@ -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
 
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.574",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,