diff --git a/android/app/src/main/java/com/reactnativenavigation/params/StyleParams.java b/android/app/src/main/java/com/reactnativenavigation/params/StyleParams.java index 17ffcf064fa..74e0c9f8794 100644 --- a/android/app/src/main/java/com/reactnativenavigation/params/StyleParams.java +++ b/android/app/src/main/java/com/reactnativenavigation/params/StyleParams.java @@ -152,6 +152,8 @@ public String toString() { public Color bottomTabBadgeTextColor; public Color bottomTabBadgeBackgroundColor; public Font bottomTabFontFamily; + public Integer bottomTabFontSize; + public Integer bottomTabSelectedFontSize; public Color navigationBarColor; diff --git a/android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java b/android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java index 04b45d14be1..a33ab18b6c1 100644 --- a/android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java +++ b/android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java @@ -102,6 +102,8 @@ public StyleParams parse() { result.forceTitlesDisplay = getBoolean("forceTitlesDisplay", getDefaultForceTitlesDisplay()); result.bottomTabFontFamily = getFont("bottomTabFontFamily", getDefaultBottomTabsFontFamily()); + result.bottomTabFontSize = getIntegerOrNull("bottomTabFontSize"); + result.bottomTabSelectedFontSize = getIntegerOrNull("bottomTabSelectedFontSize"); return result; } @@ -125,6 +127,8 @@ private StyleParams createDefaultStyleParams() { result.titleBarHideOnScroll = false; result.orientation = Orientation.auto; result.bottomTabFontFamily = new StyleParams.Font(); + result.bottomTabFontSize = 10; + result.bottomTabSelectedFontSize = 10; result.titleBarTitleFont = new StyleParams.Font(); result.titleBarSubtitleFontFamily = new StyleParams.Font(); result.titleBarButtonFontFamily = new StyleParams.Font(); @@ -361,6 +365,10 @@ private int getInt(String key, int defaultValue) { return params.containsKey(key) ? params.getInt(key) : defaultValue; } + private Integer getIntegerOrNull(String key) { + return params.containsKey(key) ? params.getInt(key) : null; + } + private Bundle getBundle(String key) { return params.containsKey(key) ? params.getBundle(key) : Bundle.EMPTY; } diff --git a/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java b/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java index 7ca224e6edc..86a0a852d55 100644 --- a/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java +++ b/android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java @@ -26,6 +26,7 @@ public BottomTabs(Context context) { createVisibilityAnimator(); setStyle(); setFontFamily(); + setFontSize(); } public void addTabs(List params, OnTabSelectedListener onTabSelectedListener) { @@ -156,4 +157,10 @@ private void setFontFamily() { setTitleTypeface(AppStyle.appStyle.bottomTabFontFamily.get()); } } + + private void setFontSize() { + if(AppStyle.appStyle.bottomTabSelectedFontSize != null && AppStyle.appStyle.bottomTabFontSize != null) { + setTitleTextSizeInSp(AppStyle.appStyle.bottomTabSelectedFontSize, AppStyle.appStyle.bottomTabFontSize); + } + } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7fb4cf5de7a..4915495504f 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 12 16:05:44 IDT 2016 +#Mon Feb 19 11:46:35 EET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/docs/styling-the-tab-bar.md b/docs/styling-the-tab-bar.md index 95863f708de..906ddaf5b9f 100644 --- a/docs/styling-the-tab-bar.md +++ b/docs/styling-the-tab-bar.md @@ -38,7 +38,9 @@ Navigation.startTabBasedApp({ tabBarButtonColor: '#ffffff', tabBarSelectedButtonColor: '#63d7cc', tabBarTranslucent: false, - tabFontFamily: 'Avenir-Medium' // existing font family name or asset file without extension which can be '.ttf' or '.otf' (searched only if '.ttf' asset not found) + tabFontFamily: 'Avenir-Medium', // existing font family name or asset file without extension which can be '.ttf' or '.otf' (searched only if '.ttf' asset not found) + tabFontSize: 10, + selectedTabFontSize: 12, }, ... } diff --git a/src/deprecated/platformSpecificDeprecated.android.js b/src/deprecated/platformSpecificDeprecated.android.js index 17b24c2bf82..615ac3888bc 100644 --- a/src/deprecated/platformSpecificDeprecated.android.js +++ b/src/deprecated/platformSpecificDeprecated.android.js @@ -227,6 +227,8 @@ function convertStyleParams(originalStyleObject) { bottomTabBadgeTextColor: processColor(originalStyleObject.bottomTabBadgeTextColor), bottomTabBadgeBackgroundColor: processColor(originalStyleObject.bottomTabBadgeBackgroundColor), bottomTabFontFamily: originalStyleObject.tabFontFamily, + bottomTabFontSize: originalStyleObject.tabFontSize, + bottomTabSelectedFontSize: originalStyleObject.selectedTabFontSize, navigationBarColor: processColor(originalStyleObject.navigationBarColor) };