react-native-navigation 7.25.4 → 7.26.0-alpha.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/main/java/com/reactnativenavigation/NavigationActivity.java +9 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/BottomTabOptions.java +0 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/OverlayOptions.java +2 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/parsers/JSONParser.java +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabPresenter.java +1 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +4 -31
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java +13 -6
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +46 -62
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java +0 -4
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java +6 -20
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/OverlayManager.kt +33 -104
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/parent/ParentController.java +9 -86
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java +0 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java +2 -19
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackPresenter.java +244 -212
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/TopBarController.kt +22 -185
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonController.kt +5 -32
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +1 -9
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/RootPresenter.java +1 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/ViewController.java +0 -12
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabs.java +1 -29
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainer.kt +0 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java +1 -10
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/component/ComponentLayout.java +2 -10
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/sidemenu/SideMenuRoot.java +1 -9
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/StackLayout.java +4 -14
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/TopBar.java +1 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/ButtonBar.kt +12 -7
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleAndButtonsContainer.kt +2 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/stack/topbar/titlebar/TitleSubTitleLayout.kt +7 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/toptabs/TopTabsStyleHelper.java +1 -0
- package/lib/dist/src/interfaces/Options.d.ts +0 -24
- package/lib/src/interfaces/Options.ts +0 -26
- package/package.json +1 -1
- package/lib/android/app/src/main/java/com/reactnativenavigation/options/OverlayOptions.kt +0 -31
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/overlay/AttachedOverlayContainer.kt +0 -69
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/overlay/ViewTooltip.java +0 -921
|
@@ -3,145 +3,74 @@ package com.reactnativenavigation.viewcontrollers.overlay
|
|
|
3
3
|
import android.content.res.Configuration
|
|
4
4
|
import android.view.View
|
|
5
5
|
import android.view.ViewGroup
|
|
6
|
-
import com.reactnativenavigation.options.OverlayAttachOptions
|
|
7
|
-
import com.reactnativenavigation.options.OverlayOptions
|
|
8
6
|
import com.reactnativenavigation.react.CommandListener
|
|
9
7
|
import com.reactnativenavigation.utils.CoordinatorLayoutUtils
|
|
10
|
-
import com.reactnativenavigation.utils.removeFromParent
|
|
11
|
-
import com.reactnativenavigation.viewcontrollers.component.ComponentViewController
|
|
12
8
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController
|
|
13
9
|
import com.reactnativenavigation.views.BehaviourDelegate
|
|
14
|
-
import com.reactnativenavigation.views.overlay.ViewTooltip
|
|
15
|
-
|
|
16
|
-
private fun View.closeNow() {
|
|
17
|
-
if (this is ViewTooltip.TooltipView) {
|
|
18
|
-
this.closeNow()
|
|
19
|
-
} else {
|
|
20
|
-
removeFromParent()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
private class OverlayEntry(
|
|
25
|
-
var overlayView: View,
|
|
26
|
-
val viewController: ViewController<*>
|
|
27
|
-
)
|
|
28
10
|
|
|
29
11
|
class OverlayManager {
|
|
30
|
-
private val overlayRegistry = mutableMapOf<String,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (overlayAttachOptions.anchorId.hasValue()) {
|
|
38
|
-
anchorOverlayInParent(overlayAttachOptions, overlayController, listener)
|
|
39
|
-
} else {
|
|
40
|
-
attachOverlayToParent(overlayAttachOptions, overlayController, listener)
|
|
12
|
+
private val overlayRegistry = mutableMapOf<String, ViewController<*>>()
|
|
13
|
+
fun show(overlaysContainer: ViewGroup, overlay: ViewController<*>, listener: CommandListener) {
|
|
14
|
+
overlaysContainer.visibility = View.VISIBLE
|
|
15
|
+
overlayRegistry[overlay.id] = overlay
|
|
16
|
+
overlay.addOnAppearedListener {
|
|
17
|
+
overlay.onViewDidAppear()
|
|
18
|
+
listener.onSuccess(overlay.id)
|
|
41
19
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
overlayController: ViewController<*>,
|
|
47
|
-
listener: CommandListener
|
|
48
|
-
) {
|
|
49
|
-
val parent = if (overlayAttachOptions.layoutId.hasValue()) {
|
|
50
|
-
findController(overlayAttachOptions.layoutId.get())?.view
|
|
51
|
-
} else mainOverlayContainer
|
|
52
|
-
|
|
53
|
-
parent?.let {
|
|
54
|
-
it.visibility = View.VISIBLE
|
|
55
|
-
registerOverlay(overlayController.view,overlayController, listener)
|
|
56
|
-
it.addView(
|
|
57
|
-
overlayController.view,
|
|
58
|
-
CoordinatorLayoutUtils.matchParentWithBehaviour(BehaviourDelegate(overlayController))
|
|
59
|
-
)
|
|
60
|
-
} ?: listener.onError("Cannot find layout with id " + overlayAttachOptions.layoutId)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private fun anchorOverlayInParent(
|
|
64
|
-
overlayAttachOptions: OverlayAttachOptions,
|
|
65
|
-
overlayController: ViewController<*>,
|
|
66
|
-
listener: CommandListener
|
|
67
|
-
) {
|
|
68
|
-
val hostController = findController(overlayAttachOptions.layoutId.get())
|
|
69
|
-
if (hostController != null) {
|
|
70
|
-
val anchorView: View? = findAnchorView(overlayAttachOptions)
|
|
71
|
-
if (anchorView != null) {
|
|
72
|
-
if(overlayController is ComponentViewController){
|
|
73
|
-
overlayController.ignoreInsets(true)
|
|
74
|
-
}
|
|
75
|
-
val anchoredView =
|
|
76
|
-
hostController.showAnchoredOverlay(anchorView, overlayAttachOptions, overlayController)
|
|
77
|
-
anchoredView?.let {
|
|
78
|
-
registerOverlay(it,overlayController, listener)
|
|
79
|
-
} ?: listener.onError("Parent could not create anchored view, it could be null parent")
|
|
80
|
-
} else {
|
|
81
|
-
listener.onError("Cannot find anchor view with id " + overlayAttachOptions.anchorId)
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
listener.onError("Cannot find layout with id " + overlayAttachOptions.layoutId)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
private fun registerOverlay(
|
|
89
|
-
view:View,
|
|
90
|
-
viewController: ViewController<*>,
|
|
91
|
-
listener: CommandListener
|
|
92
|
-
) {
|
|
93
|
-
overlayRegistry[viewController.id] = OverlayEntry(view, viewController)
|
|
94
|
-
viewController.onViewDidAppear()
|
|
95
|
-
listener.onSuccess(viewController.id)
|
|
20
|
+
overlaysContainer.addView(
|
|
21
|
+
overlay.view,
|
|
22
|
+
CoordinatorLayoutUtils.matchParentWithBehaviour(BehaviourDelegate(overlay))
|
|
23
|
+
)
|
|
96
24
|
}
|
|
97
25
|
|
|
98
26
|
fun onConfigurationChanged(configuration: Configuration?) {
|
|
99
|
-
overlayRegistry.values.forEach {
|
|
27
|
+
overlayRegistry.values.forEach { controller -> controller.onConfigurationChanged(configuration) }
|
|
100
28
|
}
|
|
101
29
|
|
|
102
|
-
fun dismiss(componentId: String, listener: CommandListener) {
|
|
30
|
+
fun dismiss(overlaysContainer: ViewGroup, componentId: String, listener: CommandListener) {
|
|
103
31
|
val overlay = overlayRegistry.remove(componentId)
|
|
104
32
|
if (overlay == null) {
|
|
105
33
|
listener.onError("Could not dismiss Overlay. Overlay with id $componentId was not found.")
|
|
106
34
|
} else {
|
|
107
|
-
destroyOverlay(overlay)
|
|
35
|
+
destroyOverlay(overlaysContainer, overlay)
|
|
108
36
|
listener.onSuccess(componentId)
|
|
109
37
|
}
|
|
110
38
|
}
|
|
111
39
|
|
|
112
|
-
fun dismissAll() {
|
|
113
|
-
destroy()
|
|
40
|
+
fun dismissAll(overlaysContainer: ViewGroup, listener: CommandListener) {
|
|
41
|
+
destroy(overlaysContainer)
|
|
42
|
+
listener.onSuccess("")
|
|
114
43
|
}
|
|
115
44
|
|
|
116
|
-
fun destroy() {
|
|
117
|
-
val
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
overlayRegistry.remove(first.key)
|
|
45
|
+
fun destroy(overlaysContainer: ViewGroup) {
|
|
46
|
+
val removedOverlays = overlayRegistry.values.map { overlay ->
|
|
47
|
+
destroyOverlay(overlaysContainer, overlay)
|
|
48
|
+
overlay.id
|
|
49
|
+
}.toList()
|
|
50
|
+
removedOverlays.forEach {
|
|
51
|
+
overlayRegistry.remove(it)
|
|
124
52
|
}
|
|
125
|
-
mainOverlayContainer?.visibility = View.GONE
|
|
126
53
|
}
|
|
127
54
|
|
|
128
55
|
fun size() = overlayRegistry.size
|
|
129
56
|
|
|
130
57
|
fun findControllerById(id: String?): ViewController<*>? {
|
|
131
|
-
return overlayRegistry[id]
|
|
58
|
+
return overlayRegistry[id]
|
|
132
59
|
}
|
|
133
60
|
|
|
134
|
-
private fun destroyOverlay(overlay:
|
|
135
|
-
overlay
|
|
136
|
-
|
|
137
|
-
if (overlayRegistry.isEmpty()) mainOverlayContainer?.visibility = View.GONE
|
|
61
|
+
private fun destroyOverlay(overlaysContainer: ViewGroup, overlay: ViewController<*>) {
|
|
62
|
+
overlay.destroy()
|
|
63
|
+
if (isEmpty) overlaysContainer.visibility = View.GONE
|
|
138
64
|
}
|
|
139
65
|
|
|
66
|
+
private val isEmpty: Boolean
|
|
67
|
+
get() = size() == 0
|
|
68
|
+
|
|
140
69
|
fun onHostPause() {
|
|
141
|
-
overlayRegistry.values.forEach
|
|
70
|
+
overlayRegistry.values.forEach(ViewController<*>::onViewDisappear)
|
|
142
71
|
}
|
|
143
72
|
|
|
144
73
|
fun onHostResume() {
|
|
145
|
-
overlayRegistry.values.forEach
|
|
74
|
+
overlayRegistry.values.forEach(ViewController<*>::onViewDidAppear)
|
|
146
75
|
}
|
|
147
76
|
}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
package com.reactnativenavigation.viewcontrollers.parent;
|
|
2
2
|
|
|
3
|
-
import static com.reactnativenavigation.utils.CollectionUtils.forEach;
|
|
4
|
-
import static com.reactnativenavigation.utils.ObjectUtils.perform;
|
|
5
|
-
|
|
6
3
|
import android.app.Activity;
|
|
7
4
|
import android.content.res.Configuration;
|
|
8
5
|
import android.view.View;
|
|
9
6
|
import android.view.ViewGroup;
|
|
10
7
|
|
|
11
|
-
import androidx.annotation.CallSuper;
|
|
12
|
-
import androidx.annotation.CheckResult;
|
|
13
|
-
import androidx.annotation.NonNull;
|
|
14
|
-
import androidx.annotation.Nullable;
|
|
15
|
-
import androidx.viewpager.widget.ViewPager;
|
|
16
|
-
|
|
17
8
|
import com.reactnativenavigation.options.Options;
|
|
18
|
-
import com.reactnativenavigation.options.OverlayAttachOptions;
|
|
19
9
|
import com.reactnativenavigation.options.params.Bool;
|
|
20
10
|
import com.reactnativenavigation.utils.CollectionUtils;
|
|
21
11
|
import com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController;
|
|
22
12
|
import com.reactnativenavigation.viewcontrollers.child.ChildController;
|
|
23
13
|
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
24
|
-
import com.reactnativenavigation.viewcontrollers.stack.StackController;
|
|
25
14
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
26
15
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
27
16
|
import com.reactnativenavigation.views.component.Component;
|
|
28
17
|
|
|
29
18
|
import java.util.Collection;
|
|
30
|
-
|
|
31
|
-
import
|
|
19
|
+
|
|
20
|
+
import androidx.annotation.CallSuper;
|
|
21
|
+
import androidx.annotation.CheckResult;
|
|
22
|
+
import androidx.annotation.NonNull;
|
|
23
|
+
import androidx.annotation.Nullable;
|
|
24
|
+
import androidx.viewpager.widget.ViewPager;
|
|
25
|
+
|
|
26
|
+
import static com.reactnativenavigation.utils.CollectionUtils.*;
|
|
27
|
+
import static com.reactnativenavigation.utils.ObjectUtils.perform;
|
|
32
28
|
|
|
33
29
|
public abstract class ParentController<T extends ViewGroup> extends ChildController<T> {
|
|
34
30
|
|
|
@@ -92,10 +88,6 @@ public abstract class ParentController<T extends ViewGroup> extends ChildControl
|
|
|
92
88
|
|
|
93
89
|
public abstract ViewController<?> getCurrentChild();
|
|
94
90
|
|
|
95
|
-
public List<ViewController<?>> getChildren(){
|
|
96
|
-
return Collections.emptyList();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
91
|
@NonNull
|
|
100
92
|
@Override
|
|
101
93
|
public abstract T createView();
|
|
@@ -111,51 +103,6 @@ public abstract class ParentController<T extends ViewGroup> extends ChildControl
|
|
|
111
103
|
return perform(getParentController(), null, ParentController::getBottomTabsController);
|
|
112
104
|
}
|
|
113
105
|
|
|
114
|
-
@Override
|
|
115
|
-
protected View findTooltipAnchorView(OverlayAttachOptions options) {
|
|
116
|
-
final String id = options.anchorId.get();
|
|
117
|
-
View found = null;
|
|
118
|
-
final View topBarView = findTopBarViewById(id);
|
|
119
|
-
if (topBarView != null) {
|
|
120
|
-
found = topBarView;
|
|
121
|
-
} else {
|
|
122
|
-
final View bottomTabViewById = findBottomTabViewById(id);
|
|
123
|
-
if (bottomTabViewById != null) {
|
|
124
|
-
found = bottomTabViewById;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return found;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@Nullable
|
|
131
|
-
protected View findTopBarViewById(String id) {
|
|
132
|
-
final View[] found = {null};
|
|
133
|
-
lookup((controller) -> {
|
|
134
|
-
if (controller instanceof StackController) {
|
|
135
|
-
final StackController stackController = (StackController) controller;
|
|
136
|
-
final View topBarViewById = stackController.presenter.findTopBarViewById(id);
|
|
137
|
-
found[0] = topBarViewById;
|
|
138
|
-
return topBarViewById != null;
|
|
139
|
-
}
|
|
140
|
-
return false;
|
|
141
|
-
});
|
|
142
|
-
return found[0];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@Nullable
|
|
146
|
-
protected View findBottomTabViewById(@NonNull String id) {
|
|
147
|
-
final View[] found = {null};
|
|
148
|
-
lookup((controller) -> {
|
|
149
|
-
if (controller instanceof BottomTabsController) {
|
|
150
|
-
BottomTabsController bottomTabsController = (BottomTabsController) controller;
|
|
151
|
-
found[0] = bottomTabsController.getTabViewByTag(id);
|
|
152
|
-
return found[0] != null;
|
|
153
|
-
}
|
|
154
|
-
return false;
|
|
155
|
-
});
|
|
156
|
-
return found[0];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
106
|
@Nullable
|
|
160
107
|
@Override
|
|
161
108
|
public ViewController<?> findController(final String id) {
|
|
@@ -257,30 +204,6 @@ public abstract class ParentController<T extends ViewGroup> extends ChildControl
|
|
|
257
204
|
return getCurrentChild().getCurrentComponentName();
|
|
258
205
|
}
|
|
259
206
|
|
|
260
|
-
protected interface LookupPredicate<T> {
|
|
261
|
-
boolean test(T t);
|
|
262
|
-
}
|
|
263
|
-
public ViewController<?> lookup(LookupPredicate<ViewController<?>> predicate){
|
|
264
|
-
if(predicate.test(this)){
|
|
265
|
-
return this;
|
|
266
|
-
}else{
|
|
267
|
-
final List<ViewController<?>> children = getChildren();
|
|
268
|
-
for(ViewController<?> child : children){
|
|
269
|
-
if(child instanceof ParentController){
|
|
270
|
-
ViewController<?> result= ((ParentController<?>) child).lookup(predicate);
|
|
271
|
-
if(result!=null){
|
|
272
|
-
return result;
|
|
273
|
-
}
|
|
274
|
-
}else{
|
|
275
|
-
if(predicate.test(child)){
|
|
276
|
-
return child;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
207
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
285
208
|
super.onConfigurationChanged(newConfig);
|
|
286
209
|
Collection<? extends ViewController<?>> childControllers = getChildControllers();
|
|
@@ -3,10 +3,8 @@ package com.reactnativenavigation.viewcontrollers.sidemenu;
|
|
|
3
3
|
import android.app.Activity;
|
|
4
4
|
import android.view.Gravity;
|
|
5
5
|
import android.view.View;
|
|
6
|
-
import android.view.ViewGroup;
|
|
7
6
|
|
|
8
7
|
import com.reactnativenavigation.options.Options;
|
|
9
|
-
import com.reactnativenavigation.options.OverlayAttachOptions;
|
|
10
8
|
import com.reactnativenavigation.options.SideMenuRootOptions;
|
|
11
9
|
import com.reactnativenavigation.options.params.Bool;
|
|
12
10
|
import com.reactnativenavigation.react.CommandListener;
|
|
@@ -14,7 +12,6 @@ import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
|
|
|
14
12
|
import com.reactnativenavigation.viewcontrollers.parent.ParentController;
|
|
15
13
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
16
14
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
17
|
-
import com.reactnativenavigation.views.overlay.ViewTooltip;
|
|
18
15
|
import com.reactnativenavigation.views.sidemenu.SideMenu;
|
|
19
16
|
import com.reactnativenavigation.views.sidemenu.SideMenuRoot;
|
|
20
17
|
|
|
@@ -68,15 +65,6 @@ public class SideMenuController extends ParentController<SideMenuRoot> implement
|
|
|
68
65
|
return root;
|
|
69
66
|
}
|
|
70
67
|
|
|
71
|
-
@Override
|
|
72
|
-
public ViewTooltip.TooltipView showAnchoredOverlay(@NonNull View anchorView, @NonNull OverlayAttachOptions overlayAttachOptions, @NonNull ViewController<?> overlayViewController) {
|
|
73
|
-
if (view != null) {
|
|
74
|
-
return view.getAttachedOverlayContainer().addAnchoredView(anchorView, overlayViewController.getView(),
|
|
75
|
-
overlayAttachOptions.gravity.get());
|
|
76
|
-
}
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
68
|
@Override
|
|
81
69
|
public void sendOnNavigationButtonPressed(String buttonId) {
|
|
82
70
|
center.sendOnNavigationButtonPressed(buttonId);
|
|
@@ -8,7 +8,6 @@ import android.view.ViewGroup;
|
|
|
8
8
|
import com.facebook.react.ReactRootView;
|
|
9
9
|
import com.reactnativenavigation.options.ButtonOptions;
|
|
10
10
|
import com.reactnativenavigation.options.Options;
|
|
11
|
-
import com.reactnativenavigation.options.OverlayAttachOptions;
|
|
12
11
|
import com.reactnativenavigation.options.StackAnimationOptions;
|
|
13
12
|
import com.reactnativenavigation.react.CommandListener;
|
|
14
13
|
import com.reactnativenavigation.react.CommandListenerAdapter;
|
|
@@ -20,7 +19,6 @@ import com.reactnativenavigation.viewcontrollers.stack.topbar.TopBarController;
|
|
|
20
19
|
import com.reactnativenavigation.viewcontrollers.stack.topbar.button.BackButtonHelper;
|
|
21
20
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
|
|
22
21
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
23
|
-
import com.reactnativenavigation.views.overlay.ViewTooltip;
|
|
24
22
|
import com.reactnativenavigation.views.component.Component;
|
|
25
23
|
import com.reactnativenavigation.views.stack.StackBehaviour;
|
|
26
24
|
import com.reactnativenavigation.views.stack.StackLayout;
|
|
@@ -34,7 +32,6 @@ import java.util.Iterator;
|
|
|
34
32
|
import java.util.List;
|
|
35
33
|
|
|
36
34
|
import androidx.annotation.NonNull;
|
|
37
|
-
import androidx.annotation.Nullable;
|
|
38
35
|
import androidx.annotation.RestrictTo;
|
|
39
36
|
import androidx.annotation.Size;
|
|
40
37
|
import androidx.annotation.VisibleForTesting;
|
|
@@ -54,7 +51,7 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
54
51
|
private final EventEmitter eventEmitter;
|
|
55
52
|
private final TopBarController topBarController;
|
|
56
53
|
private final BackButtonHelper backButtonHelper;
|
|
57
|
-
|
|
54
|
+
private final StackPresenter presenter;
|
|
58
55
|
private final FabPresenter fabPresenter;
|
|
59
56
|
|
|
60
57
|
public StackController(Activity activity, List<ViewController<?>> children, ChildControllersRegistry childRegistry, EventEmitter eventEmitter, TopBarController topBarController, StackAnimator animator, String id, Options initialOptions, BackButtonHelper backButtonHelper, StackPresenter stackPresenter, Presenter presenter, FabPresenter fabPresenter) {
|
|
@@ -72,7 +69,7 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
72
69
|
@Override
|
|
73
70
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
74
71
|
super.onConfigurationChanged(newConfig);
|
|
75
|
-
presenter.onConfigurationChanged(resolveCurrentOptions()
|
|
72
|
+
presenter.onConfigurationChanged(resolveCurrentOptions());
|
|
76
73
|
fabPresenter.onConfigurationChanged(resolveCurrentOptions());
|
|
77
74
|
}
|
|
78
75
|
|
|
@@ -481,20 +478,6 @@ public class StackController extends ParentController<StackLayout> {
|
|
|
481
478
|
return false;
|
|
482
479
|
}
|
|
483
480
|
|
|
484
|
-
@Override
|
|
485
|
-
public ViewTooltip.TooltipView showAnchoredOverlay(@NonNull View anchorView, @NonNull OverlayAttachOptions overlayAttachOptions, @NonNull ViewController<?> overlayViewController) {
|
|
486
|
-
if(view!=null){
|
|
487
|
-
return( (StackLayout)view).getAttachedOverlayContainer().addAnchoredView(anchorView, overlayViewController.getView(),
|
|
488
|
-
overlayAttachOptions.gravity.get());
|
|
489
|
-
}
|
|
490
|
-
return null;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
@Override
|
|
494
|
-
public List<ViewController<?>> getChildren() {
|
|
495
|
-
return stack.values();
|
|
496
|
-
}
|
|
497
|
-
|
|
498
481
|
@Override
|
|
499
482
|
public int getTopInset(ViewController<?> child) {
|
|
500
483
|
return presenter.getTopInset(resolveChildOptions(child));
|