Selaa lähdekoodia

Added TitleState showWhenActiveForce option for bottomTabs (#5814)

* Updated ahbottomnavigation to 3.0.9
Benoît Jeaurond 4 vuotta sitten
vanhempi
commit
cf18e2d3c9

+ 1
- 1
docs/docs/styling.md Näytä tiedosto

@@ -285,7 +285,7 @@ Navigation.mergeOptions(this.props.componentId, {
285 285
   },
286 286
   bottomTabs: {
287 287
     elevation: 8, // BottomTabs elevation in dp
288
-    titleDisplayMode: 'alwaysShow' | 'showWhenActive' | 'alwaysHide' // Sets the title state for each tab.
288
+    titleDisplayMode: 'alwaysShow' | 'showWhenActive' | 'alwaysHide' | 'showWhenActiveForce' // Sets the title state for each tab. (showWhenActiveForce to be used when showWhenActive doesn't work, e.g. with three bottom tabs)
289 289
   },
290 290
   bottomTab: {
291 291
     selectedFontSize: 19 // Selected tab font size in sp

+ 1
- 1
lib/android/app/build.gradle Näytä tiedosto

@@ -97,7 +97,7 @@ dependencies {
97 97
     implementation 'androidx.annotation:annotation:1.1.0'
98 98
     implementation 'com.google.android.material:material:1.1.0-alpha08'
99 99
 
100
-    implementation 'com.github.wix-playground:ahbottomnavigation:3.0.8'
100
+    implementation 'com.github.wix-playground:ahbottomnavigation:3.0.9'
101 101
     implementation 'com.github.wix-playground:reflow-animator:1.0.4'
102 102
     implementation 'com.github.clans:fab:1.6.4'
103 103
 

+ 4
- 1
lib/android/app/src/main/java/com/reactnativenavigation/parse/params/TitleDisplayMode.java Näytä tiedosto

@@ -7,7 +7,7 @@ import com.aurelhubert.ahbottomnavigation.AHBottomNavigation.TitleState;
7 7
 import javax.annotation.Nullable;
8 8
 
9 9
 public enum TitleDisplayMode {
10
-    ALWAYS_SHOW(TitleState.ALWAYS_SHOW), SHOW_WHEN_ACTIVE(TitleState.SHOW_WHEN_ACTIVE), ALWAYS_HIDE(TitleState.ALWAYS_HIDE), UNDEFINED(null);
10
+    ALWAYS_SHOW(TitleState.ALWAYS_SHOW), SHOW_WHEN_ACTIVE(TitleState.SHOW_WHEN_ACTIVE), ALWAYS_HIDE(TitleState.ALWAYS_HIDE), SHOW_WHEN_ACTIVE_FORCE(TitleState.SHOW_WHEN_ACTIVE_FORCE), UNDEFINED(null);
11 11
 
12 12
     public static TitleDisplayMode fromString(String mode) {
13 13
         switch (mode) {
@@ -17,6 +17,8 @@ public enum TitleDisplayMode {
17 17
                 return SHOW_WHEN_ACTIVE;
18 18
             case Constants.ALWAYS_HIDE:
19 19
                 return ALWAYS_HIDE;
20
+            case Constants.SHOW_WHEN_ACTIVE_FORCE:
21
+                return SHOW_WHEN_ACTIVE_FORCE;
20 22
             default:
21 23
                 return UNDEFINED;
22 24
         }
@@ -45,6 +47,7 @@ public enum TitleDisplayMode {
45 47
     private static class Constants {
46 48
         static final String ALWAYS_SHOW = "alwaysShow";
47 49
         static final String SHOW_WHEN_ACTIVE = "showWhenActive";
50
+        static final String SHOW_WHEN_ACTIVE_FORCE = "showWhenActiveForce";
48 51
         static final String ALWAYS_HIDE = "alwaysHide";
49 52
     }
50 53
 }

+ 1
- 1
lib/src/interfaces/Options.ts Näytä tiedosto

@@ -532,7 +532,7 @@ export interface OptionsBottomTabs {
532 532
    * Control the text display mode below the tab icon
533 533
    * #### (Android specific)
534 534
    */
535
-  titleDisplayMode?: 'alwaysShow' | 'showWhenActive' | 'alwaysHide';
535
+  titleDisplayMode?: 'alwaysShow' | 'showWhenActive' | 'alwaysHide' | 'showWhenActiveForce';
536 536
   /**
537 537
    * Set the elevation of the Bottom Tabs in dp
538 538
    * #### (Android specific)