react-native-navigation 7.47.0 → 7.49.0

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.
Files changed (21) hide show
  1. package/lib/android/app/build.gradle +2 -1
  2. package/lib/android/app/src/main/java/com/reactnativenavigation/FeatureToggles.kt +2 -0
  3. package/lib/android/app/src/main/java/com/reactnativenavigation/options/BottomTabsOptions.java +21 -1
  4. package/lib/android/app/src/main/java/com/reactnativenavigation/options/LayoutDirection.java +6 -1
  5. package/lib/android/app/src/main/java/com/reactnativenavigation/options/params/BottomTabsLayoutStyle.kt +20 -0
  6. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ColorUtils.java +4 -0
  7. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java +12 -2
  8. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsPresenter.kt +129 -11
  9. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/component/ComponentViewController.java +2 -1
  10. package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabs.java +6 -6
  11. package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsContainer.kt +83 -5
  12. package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java +58 -6
  13. package/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/ShadowLayout.kt +4 -8
  14. package/lib/dist/src/interfaces/Options.d.ts +46 -3
  15. package/lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.h +22 -0
  16. package/lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.m +782 -161
  17. package/lib/ios/RNNSideMenuPresenter.m +27 -0
  18. package/lib/ios/RNNSideMenuSideOptions.h +6 -0
  19. package/lib/ios/RNNSideMenuSideOptions.m +13 -1
  20. package/lib/src/interfaces/Options.ts +46 -3
  21. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  #import "RNNSideMenuPresenter.h"
2
2
  #import "RNNSideMenuController.h"
3
+ #import "RNNSideMenuSideOptions.h"
3
4
 
4
5
  @implementation RNNSideMenuPresenter
5
6
 
@@ -52,6 +53,20 @@
52
53
 
53
54
  [self.sideMenuController.view
54
55
  setBackgroundColor:[withDefault.layout.backgroundColor withDefault:nil]];
56
+
57
+ MMDrawerOpenMode openModeLeft = MMDrawerOpenModePushContent; // Default value
58
+ if (withDefault.sideMenu.left.openMode.hasValue) {
59
+ NSString *openModeString = withDefault.sideMenu.left.openMode.get;
60
+ openModeLeft = MMDrawerOpenModeFromString(openModeString);
61
+ }
62
+ [self.sideMenuController side:MMDrawerSideLeft openMode:openModeLeft];
63
+
64
+ MMDrawerOpenMode openModeRight = MMDrawerOpenModePushContent; // Default value
65
+ if (withDefault.sideMenu.right.openMode.hasValue) {
66
+ NSString *openModeString = withDefault.sideMenu.right.openMode.get;
67
+ openModeRight = MMDrawerOpenModeFromString(openModeString);
68
+ }
69
+ [self.sideMenuController side:MMDrawerSideRight openMode:openModeRight];
55
70
  }
56
71
 
57
72
  - (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions {
@@ -112,6 +127,18 @@
112
127
  options.sideMenu.right.shouldStretchDrawer.get;
113
128
  }
114
129
 
130
+ if (options.sideMenu.left.openMode.hasValue) {
131
+ NSString *openModeString = options.sideMenu.left.openMode.get;
132
+ MMDrawerOpenMode openMode = MMDrawerOpenModeFromString(openModeString);
133
+ [self.sideMenuController side:MMDrawerSideLeft openMode:openMode];
134
+ }
135
+
136
+ if (options.sideMenu.right.openMode.hasValue) {
137
+ NSString *openModeString = options.sideMenu.right.openMode.get;
138
+ MMDrawerOpenMode openMode = MMDrawerOpenModeFromString(openModeString);
139
+ [self.sideMenuController side:MMDrawerSideRight openMode:openMode];
140
+ }
141
+
115
142
  if (options.sideMenu.left.animationVelocity.hasValue) {
116
143
  self.sideMenuController.animationVelocityLeft = options.sideMenu.left.animationVelocity.get;
117
144
  }
@@ -8,5 +8,11 @@
8
8
  @property(nonatomic, strong) Double *width;
9
9
  @property(nonatomic, strong) Bool *shouldStretchDrawer;
10
10
  @property(nonatomic, strong) Double *animationVelocity;
11
+ @property (nonatomic, strong) Text *openMode;
11
12
 
13
+ /**
14
+ * Converts a string open mode to the equivalent MMDrawerOpenMode enum value
15
+ */
16
+ MMDrawerOpenMode MMDrawerOpenModeFromString(NSString *openModeString);
17
+
12
18
  @end
@@ -10,7 +10,7 @@
10
10
  self.width = [DoubleParser parse:dict key:@"width"];
11
11
  self.shouldStretchDrawer = [BoolParser parse:dict key:@"shouldStretchDrawer"];
12
12
  self.animationVelocity = [DoubleParser parse:dict key:@"animationVelocity"];
13
-
13
+ self.openMode = [TextParser parse:dict key:@"openMode"];
14
14
  return self;
15
15
  }
16
16
 
@@ -25,6 +25,18 @@
25
25
  self.shouldStretchDrawer = options.shouldStretchDrawer;
26
26
  if (options.animationVelocity.hasValue)
27
27
  self.animationVelocity = options.animationVelocity;
28
+ if (options.openMode.hasValue)
29
+ self.openMode = options.openMode;
30
+ }
31
+
32
+ /**
33
+ Converts a string open mode to the equivalent MMDrawerOpenMode enum value
34
+ */
35
+ MMDrawerOpenMode MMDrawerOpenModeFromString(NSString *openModeString) {
36
+ if ([openModeString isEqualToString:@"aboveContent"]) {
37
+ return MMDrawerOpenModeAboveContent;
38
+ }
39
+ return MMDrawerOpenModePushContent;
28
40
  }
29
41
 
30
42
  @end
@@ -855,7 +855,9 @@ export interface OptionsBottomTabs {
855
855
  */
856
856
  drawBehind?: boolean;
857
857
  /**
858
- * Set a background color for the bottom tabs
858
+ * Set a background color for the bottom tabs.<br/>
859
+ * On Android - also applicable when translucence is applied, but a semi-transparent
860
+ * color should be used (e.g. `rgba(255, 0, 0, 0.25)`).
859
861
  */
860
862
  backgroundColor?: Color;
861
863
  /**
@@ -871,10 +873,42 @@ export interface OptionsBottomTabs {
871
873
  */
872
874
  barStyle?: 'default' | 'black';
873
875
  /**
874
- * Allows the Bottom Tabs to be translucent (blurred)
875
- * #### (iOS specific)
876
+ * Control the way the bottom tabs are laid out.
877
+ * - `stretch`: Fill the entire width of the screen.
878
+ * - `compact`: Occupy the minimum width needed to hold tab buttons. Recommended for
879
+ * usage in conjunction with `drawBehind: true`.
880
+ *
881
+ * #### (Android specific)
882
+ * @default 'stretch'
883
+ */
884
+ layoutStyle?: 'stretch' | 'compact';
885
+ /**
886
+ * Specify a corner-radius (in dip) in order to apply round corners to the tabs container.<br/>
887
+ * Mainly suitable when used in conjunction with `layoutStyle: 'compact'`
888
+ * #### (Android specific)
889
+ */
890
+ cornerRadius?: AndroidDensityNumber;
891
+ /**
892
+ * Bottom-margin to set in order to apply a "hover" effect.
893
+ * Works best when used in conjunction with `layoutStyle: 'compact'` and `drawBehind: true`.
894
+ * #### (Android specific)
895
+ */
896
+ bottomMargin?: AndroidDensityNumber;
897
+ /**
898
+ * Allows the bottom tabs to be translucent (blurred). Doesn't necessarily play
899
+ * nice with shadow effects on Android.
900
+ * #### Android: experimental, turn on using native toggle `TAB_BAR_TRANSLUCENCE`.
876
901
  */
877
902
  translucent?: boolean;
903
+ /**
904
+ * Set a custom radius to be used in the blur effect. Higher is blurrier, but
905
+ * also more CPU-intensive.<br/>
906
+ * Note: The blurring is performed following a bitmap downscale of x4.0, so
907
+ * ultimately the actual radius is (4*blurRadius).
908
+ * #### (Android specific)
909
+ * @defaultValue 1.0
910
+ */
911
+ blurRadius?: AndroidDensityNumber;
878
912
  /**
879
913
  * Hide the top line of the Tab Bar
880
914
  * #### (iOS specific)
@@ -1078,10 +1112,19 @@ export interface SideMenuSide {
1078
1112
  height?: number;
1079
1113
  /**
1080
1114
  * Stretch sideMenu contents when opened past the width
1115
+ *
1116
+ * **Not applicable when `openMode` is `aboveContent`**
1117
+ *
1081
1118
  * #### (iOS specific)
1082
1119
  * @default true
1083
1120
  */
1084
1121
  shouldStretchDrawer?: boolean;
1122
+ /**
1123
+ * Configure the opening mode of the side menu
1124
+ * #### (iOS specific)
1125
+ * @default 'pushContent'
1126
+ */
1127
+ openMode?: 'pushContent' | 'aboveContent';
1085
1128
  }
1086
1129
 
1087
1130
  export interface OptionsSideMenu {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.47.0",
3
+ "version": "7.49.0",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,