react-native-navigation 7.27.1 → 7.28.0-snapshot.636
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/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +3 -3
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/topbar/button/ButtonPresenter.kt +1 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabs.java +2 -0
- 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;
|
|
@@ -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 {
|
|
@@ -159,6 +159,7 @@ open class ButtonPresenter(private val context: Context, private val button: But
|
|
|
159
159
|
iconResolver.resolve(button) { icon: Drawable ->
|
|
160
160
|
setIconColor(icon)
|
|
161
161
|
toolbar.setNavigationOnClickListener { onPress(button) }
|
|
162
|
+
toolbar.navigationIcon = null
|
|
162
163
|
toolbar.navigationIcon = icon
|
|
163
164
|
setLeftButtonTestId(toolbar)
|
|
164
165
|
if (button.accessibilityLabel.hasValue()) toolbar.navigationContentDescription = button.accessibilityLabel.get()
|
package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabs.java
CHANGED
|
@@ -2,6 +2,7 @@ package com.reactnativenavigation.views.bottomtabs;
|
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint;
|
|
4
4
|
import android.content.Context;
|
|
5
|
+
import android.graphics.Color;
|
|
5
6
|
import android.graphics.drawable.Drawable;
|
|
6
7
|
import android.view.View;
|
|
7
8
|
import android.widget.LinearLayout;
|
|
@@ -28,6 +29,7 @@ public class BottomTabs extends AHBottomNavigation {
|
|
|
28
29
|
public BottomTabs(Context context) {
|
|
29
30
|
super(context);
|
|
30
31
|
setId(R.id.bottomTabs);
|
|
32
|
+
setDefaultBackgroundColor(Color.TRANSPARENT);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
public void disableItemsCreation() {
|
|
@@ -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 {
|