react-native-navigation 8.3.0 → 8.3.1
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.
- package/lib/android/app/src/androidTest/java/com/reactnativenavigation/TestUtils.java +6 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutFactory.java +5 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/utils/SystemUiUtils.kt +1 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +10 -9
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +2 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewController.java +5 -0
- package/package.json +1 -1
|
@@ -43,10 +43,13 @@ public class TestUtils {
|
|
|
43
43
|
.setId("stack" + CompatUtils.generateViewId())
|
|
44
44
|
.setChildRegistry(new ChildControllersRegistry())
|
|
45
45
|
.setTopBarController(topBarController)
|
|
46
|
-
.setStackPresenter(new StackPresenter(activity,
|
|
47
|
-
new
|
|
46
|
+
.setStackPresenter(new StackPresenter(activity,
|
|
47
|
+
new TitleBarReactViewCreatorMock(),
|
|
48
|
+
new TitleBarButtonCreatorMock(),
|
|
49
|
+
topBarController,
|
|
48
50
|
new IconResolver(activity, new ImageLoader()), new TypefaceLoaderMock(), new RenderChecker(),
|
|
49
|
-
new Options()
|
|
51
|
+
new Options(),
|
|
52
|
+
new TopBarBackgroundViewCreatorMock()))
|
|
50
53
|
.setInitialOptions(new Options());
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -186,21 +186,22 @@ public class LayoutFactory {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
private ViewController<?> createStack(LayoutNode node) {
|
|
189
|
+
final TopBarController topBarController = new TopBarController();
|
|
189
190
|
return new StackControllerBuilder(activity, eventEmitter)
|
|
190
191
|
.setChildren(createChildren(node.children))
|
|
191
192
|
.setChildRegistry(childRegistry)
|
|
192
|
-
.setTopBarController(
|
|
193
|
+
.setTopBarController(topBarController)
|
|
193
194
|
.setId(node.id)
|
|
194
195
|
.setInitialOptions(parseOptions(node.getOptions()))
|
|
195
196
|
.setStackPresenter(new StackPresenter(activity,
|
|
196
197
|
new TitleBarReactViewCreator(),
|
|
197
|
-
new TopBarBackgroundViewCreator(),
|
|
198
198
|
new TitleBarButtonCreator(),
|
|
199
|
+
topBarController,
|
|
199
200
|
new IconResolver(activity, new ImageLoader()),
|
|
200
201
|
new TypefaceLoader(activity),
|
|
201
202
|
new RenderChecker(),
|
|
202
|
-
defaultOptions
|
|
203
|
-
|
|
203
|
+
defaultOptions,
|
|
204
|
+
new TopBarBackgroundViewCreator()))
|
|
204
205
|
.setPresenter(new Presenter(activity, defaultOptions))
|
|
205
206
|
.build();
|
|
206
207
|
}
|
|
@@ -12,7 +12,6 @@ import androidx.core.view.WindowInsetsControllerCompat
|
|
|
12
12
|
import kotlin.math.abs
|
|
13
13
|
import kotlin.math.ceil
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
object SystemUiUtils {
|
|
17
16
|
private const val STATUS_BAR_HEIGHT_M = 24
|
|
18
17
|
internal const val STATUS_BAR_HEIGHT_TRANSLUCENCY = 0.65f
|
|
@@ -20,7 +19,6 @@ object SystemUiUtils {
|
|
|
20
19
|
var navigationBarDefaultColor = -1
|
|
21
20
|
private set
|
|
22
21
|
|
|
23
|
-
|
|
24
22
|
@JvmStatic
|
|
25
23
|
fun getStatusBarHeight(activity: Activity?): Int {
|
|
26
24
|
val res = if (statusBarHeight > 0) {
|
|
@@ -167,4 +165,4 @@ object SystemUiUtils {
|
|
|
167
165
|
}
|
|
168
166
|
}
|
|
169
167
|
|
|
170
|
-
}
|
|
168
|
+
}
|
|
@@ -439,7 +439,7 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
439
439
|
@Override
|
|
440
440
|
public StackLayout createView() {
|
|
441
441
|
StackLayout stackLayout = new StackLayout(getActivity(), topBarController, getId());
|
|
442
|
-
presenter.bindView(
|
|
442
|
+
presenter.bindView(getBottomTabsController());
|
|
443
443
|
addInitialChild(stackLayout);
|
|
444
444
|
return stackLayout;
|
|
445
445
|
}
|
|
@@ -89,15 +89,17 @@ public class StackPresenter {
|
|
|
89
89
|
private final TypefaceLoader typefaceLoader;
|
|
90
90
|
|
|
91
91
|
public StackPresenter(Activity activity,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
TitleBarReactViewCreator titleViewCreator,
|
|
93
|
+
TitleBarButtonCreator buttonCreator,
|
|
94
|
+
TopBarController topBarController,
|
|
95
|
+
IconResolver iconResolver,
|
|
96
|
+
TypefaceLoader typefaceLoader,
|
|
97
|
+
RenderChecker renderChecker,
|
|
98
|
+
Options defaultOptions,
|
|
99
|
+
TopBarBackgroundViewCreator topBarBackgroundViewCreator) {
|
|
99
100
|
this.activity = activity;
|
|
100
101
|
this.titleViewCreator = titleViewCreator;
|
|
102
|
+
this.topBarController = topBarController;
|
|
101
103
|
this.topBarBackgroundViewCreator = topBarBackgroundViewCreator;
|
|
102
104
|
this.buttonCreator = buttonCreator;
|
|
103
105
|
this.iconResolver = iconResolver;
|
|
@@ -118,8 +120,7 @@ public class StackPresenter {
|
|
|
118
120
|
return defaultOptions;
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
public void bindView(
|
|
122
|
-
this.topBarController = topBarController;
|
|
123
|
+
public void bindView(@Nullable BottomTabsController bottomTabsController) {
|
|
123
124
|
this.bottomTabsController = bottomTabsController;
|
|
124
125
|
topBar = topBarController.getView();
|
|
125
126
|
}
|
|
@@ -120,7 +120,8 @@ class StatusBarPresenter private constructor(
|
|
|
120
120
|
|
|
121
121
|
private fun setStatusBarVisible(viewController: ViewController<*>, visible: Bool) {
|
|
122
122
|
val window = window.get() ?: return
|
|
123
|
-
val view =
|
|
123
|
+
val view = viewController.peekView() ?: window.decorView
|
|
124
|
+
|
|
124
125
|
if (visible.isFalse) {
|
|
125
126
|
hideStatusBar(window, view)
|
|
126
127
|
} else {
|
|
@@ -254,6 +254,11 @@ public abstract class ViewController<T extends ViewGroup> implements ViewTreeObs
|
|
|
254
254
|
if (view.getParent() == null) parent.addView(view, index);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
@Nullable
|
|
258
|
+
public T peekView() {
|
|
259
|
+
return view;
|
|
260
|
+
}
|
|
261
|
+
|
|
257
262
|
public String getId() {
|
|
258
263
|
return id;
|
|
259
264
|
}
|