Skip to content

setStyle to style the according TabBar#2224

Merged
guyca merged 20 commits into
wix:masterfrom
postillonmedia:master
Dec 4, 2017
Merged

setStyle to style the according TabBar#2224
guyca merged 20 commits into
wix:masterfrom
postillonmedia:master

Conversation

@danielang
Copy link
Copy Markdown
Contributor

Use navigator.setStyle({...} to set the style of TabBar of the according screen at runtime for iOS and Android.
Good for theming purpose.

Exampe:

this.props.navigator.setStyle({
        tabBarButtonColor: '#0d0d0d',
        tabBarSelectedButtonColor: '#ff6c33',
        tabBarBackgroundColor: '#ffffff',
        navigationBarColor: '#ffffff',
});

guyca
guyca previously requested changes Nov 26, 2017
}

private boolean hasBadgeTextColor(StyleParams params) {
return params.bottomTabBadgeTextColor != null &&
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid adding these convince method by initializing these style properties so they are never null here. The Color class is meant to be used as a null object

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of cause. This was original coding, so I've adapted it to match this code style.
Which color will be the default one?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to specify a default color since in this case hasColor() will return false as expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you will only check hasColor() in the setStyle function and remove the has...functions?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly :)

@danielang
Copy link
Copy Markdown
Contributor Author

any reaction? 😄

@guyca
Copy link
Copy Markdown
Collaborator

guyca commented Nov 27, 2017

@danielang Hey sorry about the delay. If I don't respond you can always try pinging me on discord. 👍

@guyca guyca dismissed their stale review December 4, 2017 10:11

dismissing

@guyca guyca merged commit 076ee73 into wix:master Dec 4, 2017
guyca added a commit that referenced this pull request Dec 5, 2017
guyca added a commit that referenced this pull request Dec 5, 2017
thanhzusu pushed a commit to thanhzusu/react-native-navigation that referenced this pull request Dec 7, 2017
* master:
  Revert "setStyle to style the according TabBar (wix#2224)" (wix#2276)
  setStyle to style the according TabBar (wix#2224)
  Fix dismissAllModal API - the root won't unregister when invoke dismissAllModals (wix#2255)
  Expose keyUp event from modals to ActivityCallback
  [iOS] Add support for bar button system items (wix#2133)
garrettm pushed a commit to Ginger-Labs/react-native-navigation that referenced this pull request Dec 19, 2017
setTabButton -> has now the property 'label' to change the label of the TabButton

iOS update style-update rutine to update each viewcontroller in a NavigationViewController
tabButtonColor improvement
garrettm pushed a commit to Ginger-Labs/react-native-navigation that referenced this pull request Dec 19, 2017
garrettm pushed a commit to Ginger-Labs/react-native-navigation that referenced this pull request Dec 19, 2017
setTabButton -> has now the property 'label' to change the label of the TabButton

iOS update style-update rutine to update each viewcontroller in a NavigationViewController
tabButtonColor improvement
garrettm pushed a commit to Ginger-Labs/react-native-navigation that referenced this pull request Dec 19, 2017
@witalobenicio
Copy link
Copy Markdown

Is this working on latest release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants