Skip to content

Commit

Permalink
Make tabBarHideShadow to be configurable on Android (#2990)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickamy authored and guyca committed Apr 10, 2018
1 parent f075b1a commit 033cb61
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Expand Up @@ -145,6 +145,7 @@ public String toString() {
public int bottomTabsInitialIndex;
public boolean bottomTabsHidden;
public boolean bottomTabsHiddenOnScroll;
public boolean bottomTabsHideShadow;
public Color bottomTabsColor;
public Color selectedBottomTabsButtonColor;
public Color bottomTabsButtonColor;
Expand Down
Expand Up @@ -86,6 +86,8 @@ public StyleParams parse() {

result.bottomTabsInitialIndex = getInt("initialTabIndex", 0);
result.bottomTabsHidden = getBoolean("bottomTabsHidden", getDefaultBottomTabsHidden());
result.bottomTabsHideShadow = getBoolean("bottomTabsHideShadow", false);

result.drawScreenAboveBottomTabs = !result.bottomTabsHidden &&
params.getBoolean("drawScreenAboveBottomTabs", getDefaultDrawScreenAboveBottomTabs());
if (result.titleBarHideOnScroll) {
Expand Down
Expand Up @@ -27,6 +27,7 @@ public BottomTabs(Context context) {
setStyle();
setFontFamily();
setFontSize();
setTabsHideShadow();
}

public void addTabs(List<ScreenParams> params, OnTabSelectedListener onTabSelectedListener) {
Expand Down Expand Up @@ -163,4 +164,8 @@ private void setFontSize() {
setTitleTextSizeInSp(AppStyle.appStyle.bottomTabSelectedFontSize, AppStyle.appStyle.bottomTabFontSize);
}
}

private void setTabsHideShadow() {
setUseElevation(!AppStyle.appStyle.bottomTabsHideShadow);
}
}
3 changes: 2 additions & 1 deletion docs/styling-the-tab-bar.md
Expand Up @@ -24,7 +24,7 @@ Navigation.startTabBasedApp({
 tabBarLabelColor: '#ffb700', // iOS only. change the color of tab text
 tabBarSelectedLabelColor: 'red', // iOS only. change the color of the selected tab text
 forceTitlesDisplay: true, // Android only. If true - Show all bottom tab labels. If false - only the selected tab's label is visible.
tabBarHideShadow: true // iOS only. Remove default tab bar top shadow (hairline)
tabBarHideShadow: true // Remove default tab bar top shadow (hairline)
}
```

Expand All @@ -36,6 +36,7 @@ Navigation.startTabBasedApp({
appStyle: {
tabBarBackgroundColor: '#0f2362',
tabBarButtonColor: '#ffffff',
tabBarHideShadow: true,
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)
Expand Down
1 change: 1 addition & 0 deletions src/deprecated/platformSpecificDeprecated.android.js
Expand Up @@ -224,6 +224,7 @@ function convertStyleParams(originalStyleObject) {
bottomTabsSelectedButtonColor: processColor(originalStyleObject.tabBarSelectedButtonColor),
bottomTabsHidden: originalStyleObject.tabBarHidden,
bottomTabsHiddenOnScroll: originalStyleObject.bottomTabsHiddenOnScroll,
bottomTabsHideShadow: originalStyleObject.tabBarHideShadow,
forceTitlesDisplay: originalStyleObject.forceTitlesDisplay,
bottomTabBadgeTextColor: processColor(originalStyleObject.bottomTabBadgeTextColor),
bottomTabBadgeBackgroundColor: processColor(originalStyleObject.bottomTabBadgeBackgroundColor),
Expand Down

0 comments on commit 033cb61

Please sign in to comment.