Browse Source

Added TitleState showWhenActiveForce option for bottomTabs (#5814)

* Updated ahbottomnavigation to 3.0.9
Benoît Jeaurond 4 years ago
parent
commit
cf18e2d3c9

+ 1
- 1
docs/docs/styling.md View File

285
   },
285
   },
286
   bottomTabs: {
286
   bottomTabs: {
287
     elevation: 8, // BottomTabs elevation in dp
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
   bottomTab: {
290
   bottomTab: {
291
     selectedFontSize: 19 // Selected tab font size in sp
291
     selectedFontSize: 19 // Selected tab font size in sp

+ 1
- 1
lib/android/app/build.gradle View File

97
     implementation 'androidx.annotation:annotation:1.1.0'
97
     implementation 'androidx.annotation:annotation:1.1.0'
98
     implementation 'com.google.android.material:material:1.1.0-alpha08'
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
     implementation 'com.github.wix-playground:reflow-animator:1.0.4'
101
     implementation 'com.github.wix-playground:reflow-animator:1.0.4'
102
     implementation 'com.github.clans:fab:1.6.4'
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 View File

7
 import javax.annotation.Nullable;
7
 import javax.annotation.Nullable;
8
 
8
 
9
 public enum TitleDisplayMode {
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
     public static TitleDisplayMode fromString(String mode) {
12
     public static TitleDisplayMode fromString(String mode) {
13
         switch (mode) {
13
         switch (mode) {
17
                 return SHOW_WHEN_ACTIVE;
17
                 return SHOW_WHEN_ACTIVE;
18
             case Constants.ALWAYS_HIDE:
18
             case Constants.ALWAYS_HIDE:
19
                 return ALWAYS_HIDE;
19
                 return ALWAYS_HIDE;
20
+            case Constants.SHOW_WHEN_ACTIVE_FORCE:
21
+                return SHOW_WHEN_ACTIVE_FORCE;
20
             default:
22
             default:
21
                 return UNDEFINED;
23
                 return UNDEFINED;
22
         }
24
         }
45
     private static class Constants {
47
     private static class Constants {
46
         static final String ALWAYS_SHOW = "alwaysShow";
48
         static final String ALWAYS_SHOW = "alwaysShow";
47
         static final String SHOW_WHEN_ACTIVE = "showWhenActive";
49
         static final String SHOW_WHEN_ACTIVE = "showWhenActive";
50
+        static final String SHOW_WHEN_ACTIVE_FORCE = "showWhenActiveForce";
48
         static final String ALWAYS_HIDE = "alwaysHide";
51
         static final String ALWAYS_HIDE = "alwaysHide";
49
     }
52
     }
50
 }
53
 }

+ 1
- 1
lib/src/interfaces/Options.ts View File

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