Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tabBarHideShadow to be configurable on Android #2990

Merged
merged 2 commits into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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