react-native-navigation 7.25.2-snapshot.560 → 7.25.4
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.
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -866,7 +866,7 @@ export interface OptionsBottomTab {
|
|
|
866
866
|
/**
|
|
867
867
|
* Set the background color of the badge that is overlayed over the component
|
|
868
868
|
*/
|
|
869
|
-
badgeColor?:
|
|
869
|
+
badgeColor?: Color;
|
|
870
870
|
/**
|
|
871
871
|
* Show the badge with the animation.
|
|
872
872
|
* #### (Android specific)
|
|
@@ -950,7 +950,7 @@ export interface OptionsBottomTab {
|
|
|
950
950
|
/**
|
|
951
951
|
* Set the background color of the badge that is overlayed over the component
|
|
952
952
|
*/
|
|
953
|
-
badgeColor?:
|
|
953
|
+
badgeColor?: Color;
|
|
954
954
|
/**
|
|
955
955
|
* Show the badge with the animation.
|
|
956
956
|
* #### (Android specific)
|