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

[Android] Updated the ColorStateList for Tab Bars containing less then 4 tabs #71

Merged
merged 1 commit into from
Apr 17, 2017
Merged

[Android] Updated the ColorStateList for Tab Bars containing less then 4 tabs #71

merged 1 commit into from
Apr 17, 2017

Conversation

Nathan-Smith
Copy link
Contributor

Props itemTextColor, itemTextActiveColor, itemTextSelectedColor and itemTextDisabledColordon't behave properly when there is 3 or less tabs.

Example:

import React from 'react';
import { TabBar, Tab } from 'native-navigation';

const propTypes = {};
const defaultProps = {};

export default class TabScreen extends React.Component {
  render() {
    return (
      <TabBar
        elevation={20}
        itemTextColor="black"
        itemTextActiveColor="green"
        itemTextSelectedColor="red"
        itemTextDisabledColor="blue"
      >
        <Tab
          route={'ScreenOne'}
          title="Home"
          image={require('../icons/home.png')}
        />
        <Tab
          route={'ScreenOne'}
          title="Chat"
          image={require('../icons/chat.png')}
        />
        <Tab
          route={'ScreenOne'}
          enabled={false}
          title="Data"
          image={require('../icons/backup.png')}
        />
      </TabBar>
    );
  }
}

TabScreen.defaultProps = defaultProps;
TabScreen.propTypes = propTypes;

This PR doesn't change the behaviour of Tab Bars containing 4 tabs or more.

Note that this change does affect icons but due to another issue in the example project the icons remain black before and after this change is applied regardless of the values assigned to itemIcon*.

@lelandrichardson
Copy link
Collaborator

Thanks 👍

@lelandrichardson lelandrichardson merged commit 61b931e into airbnb:master Apr 17, 2017
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.

2 participants