react-native-navigation 7.27.0 → 7.27.1-snapshot.632
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/autolink/postlink/activityLinker.js +25 -1
- package/autolink/postlink/appDelegateLinker.js +3 -2
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainer.kt +6 -0
- package/lib/ios/UINavigationController+RNNOptions.m +1 -1
- package/lib/ios/UIViewController+LayoutProtocol.m +2 -14
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ class ActivityLinker {
|
|
|
8
8
|
this.activityPath = path.mainActivityJava;
|
|
9
9
|
this.extendNavigationActivitySuccess = false;
|
|
10
10
|
this.removeGetMainComponentNameSuccess = false;
|
|
11
|
+
this.removeCreateReactActivityDelegate = false;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
link() {
|
|
@@ -36,6 +37,8 @@ class ActivityLinker {
|
|
|
36
37
|
errorn(' ' + e.message);
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
activityContent = this._removeCreateReactActivityDelegate(activityContent);
|
|
41
|
+
|
|
39
42
|
fs.writeFileSync(this.activityPath, activityContent);
|
|
40
43
|
if (this.extendNavigationActivitySuccess && this.removeGetMainComponentNameSuccess) {
|
|
41
44
|
infon('MainActivity linked successfully!\n');
|
|
@@ -75,7 +78,7 @@ class ActivityLinker {
|
|
|
75
78
|
'import com.reactnativenavigation.NavigationActivity;'
|
|
76
79
|
);
|
|
77
80
|
}
|
|
78
|
-
if (this._hasAlreadyExtendReactActivity) {
|
|
81
|
+
if (this._hasAlreadyExtendReactActivity(activityContent)) {
|
|
79
82
|
warnn(' MainActivity already extends NavigationActivity');
|
|
80
83
|
return activityContent;
|
|
81
84
|
}
|
|
@@ -92,6 +95,27 @@ class ActivityLinker {
|
|
|
92
95
|
_hasAlreadyExtendReactActivity(activityContent) {
|
|
93
96
|
return /public\s+class\s+MainActivity\s+extends\s+ReactActivity\s*/.test(activityContent);
|
|
94
97
|
}
|
|
98
|
+
|
|
99
|
+
_removeCreateReactActivityDelegate(activityContent) {
|
|
100
|
+
if (this._hasCreateReactActivityDelegate(activityContent)) {
|
|
101
|
+
debugn(' Removing createReactActivityDelegate function');
|
|
102
|
+
return activityContent.replace(
|
|
103
|
+
/\/\*\*(\s+\*.+)+\s+@Override\s+protected ReactActivityDelegate createReactActivityDelegate\(\) {(\s*[\w*(,);])*\s*}/,
|
|
104
|
+
'',
|
|
105
|
+
);
|
|
106
|
+
} else {
|
|
107
|
+
warnn(
|
|
108
|
+
' createReactActivityDelegate is already not defined in MainActivity',
|
|
109
|
+
);
|
|
110
|
+
return activityContent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
_hasCreateReactActivityDelegate(activityContent) {
|
|
115
|
+
return /\/\*\*(\s+\*.+)+\s+@Override\s+protected ReactActivityDelegate createReactActivityDelegate\(\) {(\s*[\w*(,);])*\s*}/.test(
|
|
116
|
+
activityContent,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
95
119
|
}
|
|
96
120
|
|
|
97
121
|
module.exports = ActivityLinker;
|
|
@@ -104,7 +104,7 @@ class AppDelegateLinker {
|
|
|
104
104
|
return content.replace(
|
|
105
105
|
/RCTBridge.*];/,
|
|
106
106
|
'RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];\n' +
|
|
107
|
-
|
|
107
|
+
'[ReactNativeNavigation bootstrapWithBridge:bridge];'
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -146,6 +146,7 @@ class AppDelegateLinker {
|
|
|
146
146
|
|
|
147
147
|
const toRemove = [
|
|
148
148
|
/RCTRootView\s+\*rootView((.|\r|\s)*?)];\s+/,
|
|
149
|
+
/UIView \*rootView = RCTAppSetupDefaultRootView\(bridge, @".*", nil\);/,
|
|
149
150
|
/if \(@available\(iOS 13\.0, \*\)\)\s{\s+ rootView.backgroundColor((.|\r)*)];\s+}\s+else {[^}]*}/,
|
|
150
151
|
/self.window((.|\r)*)];\s+/,
|
|
151
152
|
/UIViewController\s\*rootViewController((.|\r)*)];\s+/,
|
|
@@ -169,7 +170,7 @@ class AppDelegateLinker {
|
|
|
169
170
|
' No elements could be removed. Check the manual installation docs to verify that everything is properly setup:\n https://wix.github.io/react-native-navigation/docs/installing#native-installation'
|
|
170
171
|
);
|
|
171
172
|
} else {
|
|
172
|
-
|
|
173
|
+
warnn(
|
|
173
174
|
'Some elements were removed. Check the manual installation docs to verify that everything is properly setup:\n https://wix.github.io/react-native-navigation/docs/installing#native-installation'
|
|
174
175
|
);
|
|
175
176
|
}
|
|
@@ -71,7 +71,7 @@ class BottomTabsPresenter(
|
|
|
71
71
|
bottomTabs.titleState = bottomTabsOptions.titleDisplayMode.toState()
|
|
72
72
|
}
|
|
73
73
|
if (bottomTabsOptions.backgroundColor.hasValue()) {
|
|
74
|
-
|
|
74
|
+
bottomTabsContainer.setBackgroundColor(bottomTabsOptions.backgroundColor.get())
|
|
75
75
|
}
|
|
76
76
|
if (bottomTabsOptions.animateTabSelection.hasValue()) {
|
|
77
77
|
bottomTabs.setAnimateTabSelection(bottomTabsOptions.animateTabSelection.get())
|
|
@@ -143,7 +143,7 @@ class BottomTabsPresenter(
|
|
|
143
143
|
bottomTabs.setLayoutDirection(options.layout.direction)
|
|
144
144
|
bottomTabs.setPreferLargeIcons(options.bottomTabsOptions.preferLargeIcons[false])
|
|
145
145
|
bottomTabs.titleState = bottomTabsOptions.titleDisplayMode[defaultTitleState]
|
|
146
|
-
|
|
146
|
+
bottomTabsContainer.setBackgroundColor(bottomTabsOptions.backgroundColor.get(Color.WHITE)!!)
|
|
147
147
|
bottomTabs.setAnimateTabSelection(bottomTabsOptions.animateTabSelection.get(true))
|
|
148
148
|
if (bottomTabsOptions.currentTabIndex.hasValue()) {
|
|
149
149
|
val tabIndex = bottomTabsOptions.currentTabIndex.get()
|
|
@@ -175,7 +175,7 @@ class BottomTabsPresenter(
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
if (bottomTabsOptions.elevation.hasValue()) {
|
|
178
|
-
|
|
178
|
+
bottomTabsContainer.setElevation(bottomTabsOptions.elevation)
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
when {
|
|
@@ -7,6 +7,8 @@ import android.view.View
|
|
|
7
7
|
import android.widget.LinearLayout
|
|
8
8
|
import androidx.annotation.RestrictTo
|
|
9
9
|
import androidx.core.graphics.ColorUtils
|
|
10
|
+
import com.reactnativenavigation.options.params.Fraction
|
|
11
|
+
import com.reactnativenavigation.utils.UiUtils.dpToPx
|
|
10
12
|
import kotlin.math.roundToInt
|
|
11
13
|
|
|
12
14
|
|
|
@@ -91,5 +93,9 @@ class BottomTabsContainer(context: Context, val bottomTabs: BottomTabs) : Shadow
|
|
|
91
93
|
fun hideTopOutLine() {
|
|
92
94
|
topOutLineView.alpha = 0f
|
|
93
95
|
}
|
|
96
|
+
|
|
97
|
+
fun setElevation(elevation: Fraction) {
|
|
98
|
+
setElevation(dpToPx(context, elevation.get().toFloat()))
|
|
99
|
+
}
|
|
94
100
|
}
|
|
95
101
|
|
|
@@ -146,23 +146,11 @@
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
- (CGFloat)getTopBarHeight {
|
|
149
|
-
|
|
150
|
-
CGFloat childTopBarHeight = [child getTopBarHeight];
|
|
151
|
-
if (childTopBarHeight > 0)
|
|
152
|
-
return childTopBarHeight;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return 0;
|
|
149
|
+
return [self.presentedComponentViewController.navigationController getTopBarHeight];
|
|
156
150
|
}
|
|
157
151
|
|
|
158
152
|
- (CGFloat)getBottomTabsHeight {
|
|
159
|
-
|
|
160
|
-
CGFloat childBottomTabsHeight = [child getBottomTabsHeight];
|
|
161
|
-
if (childBottomTabsHeight > 0)
|
|
162
|
-
return childBottomTabsHeight;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return 0;
|
|
153
|
+
return [self.presentedComponentViewController.tabBarController getBottomTabsHeight];
|
|
166
154
|
}
|
|
167
155
|
|
|
168
156
|
- (void)screenPopped {
|