-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add show and hide animation [BottomNavigation] (#73)
* Added bottom navigation component with dacumentation, as dricribed in the material design guidelines * Fixed a bug where the list item component uses a static background instad of canvas collor * Added onPress ad required prop type * Fix bottom navigation component - moves BottomNavigationAction under BottomNavigation.Action - makes styles global, moves them to getTheme.js - adds ability to use action without label - adds missing paddingTop - adds missing comments - fixes lint * [BottomNavigation] Add show and hide animations (#55) * Remove code specific to Android in Toolbar Search (#54) All platforms (iOS, android and 3rd party windows) implements BackAndroid (iOS mocks it). * [BottomNavigation] Added component (#52) * Add bottom navigation component * Fixed a bug where the list item component uses the wrong then color refrence * Fixed a bug where the list item component uses a static background instad of canvas collor * Added onPress ad required prop type * Fix bottom navigation component - moves BottomNavigationAction under BottomNavigation.Action - makes styles global, moves them to getTheme.js - adds ability to use action without label - adds missing paddingTop - adds missing comments - fixes lint * Update BottomNavigation.md * Update README.md * Delete BottomNavigationAction.md * Bump version * Added show and hide animations to BottomNavigation component following the material design mation guidelines * Edit based on feedback in pull request * Fix eslint errors * Update jest * Add snapshot tests for Subheader * Add circle.yml * Update codecov.yml * Add codecov.io (#57) * Add tests for Container.react.js * Update README.md * [BottomNavigation] Ability to handle custom Icons instead of icon names. (#62) * [BottomNavigation] Ability to handle custom Icons instead of icon names. * Fix PropTypes. * [RippleFeedback] Use TouchableOpacity for iOS (#41) (#64) * Minor bug fix and added nativa animation driver support for android * Fixed lint error. * Added useNAtiveDriver and fixed the heigth issue * Fix getting height of bottom navigation * Fix eslint
- Loading branch information
Showing
6 changed files
with
137 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,5 @@ log.android | |
.idea | ||
webpack-assets.json | ||
*report* | ||
|
||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# [BottomNavigationAction](https://material.google.com/components/bottom-navigation.html) | ||
|
||
### Usage | ||
|
||
Check [this](https://github.com/xotahal/react-native-material-ui/blob/master/docs/BottomNavigation.md) for more infromation on the BottomNavigation component. | ||
|
||
```js | ||
... | ||
import { BottomNavigationAction } from '../react-native-material-ui'; | ||
... | ||
state = { | ||
navIndex: 0, | ||
}; | ||
|
||
render() { | ||
<BottomNavigation> | ||
<BottomNavigationAction | ||
label="Home" | ||
iconName="home" | ||
isActive={this.state.navIndex === 0} | ||
onPress={() => this.setState({navIndex: 0})} | ||
/> | ||
<BottomNavigationAction | ||
label="Collection" | ||
iconName="collections" | ||
isActive={this.state.navIndex === 1} | ||
onPress={() => this.setState({navIndex: 1})} | ||
/> | ||
<BottomNavigationAction | ||
label="Store" | ||
iconName="store" | ||
isActive={this.state.navIndex === 2} | ||
onPress={() => this.setState({navIndex: 2})} | ||
/> | ||
<BottomNavigationAction | ||
label="Menu" | ||
iconName="menu" | ||
isActive={this.state.navIndex === 3} | ||
onPress={() => this.setState({navIndex: 3})} | ||
/> | ||
</BottomNavigation> | ||
} | ||
``` | ||
### API | ||
```js | ||
const propTypes = { | ||
/** | ||
* Will be rendered above the label as a content of the action. | ||
*/ | ||
icon: PropTypes.string.isRequired, | ||
/** | ||
* Will be rendered under the icon as a content of the action. | ||
*/ | ||
label: PropTypes.string, | ||
/** | ||
* True if the action is active (for now it'll be highlight by primary color) | ||
*/ | ||
active: PropTypes.bool.isRequired, | ||
/** | ||
* Callback for on press event. | ||
*/ | ||
onPress: PropTypes.func, | ||
/** | ||
* Inline style of bottom navigation | ||
*/ | ||
style: PropTypes.shape({ | ||
container: View.propTypes.style, | ||
active: Text.propTypes.style, | ||
disabled: Text.propTypes.style, | ||
}), | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1b39688
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When scrolling up and down, show and hide animation not working in BottomNavigation.
My code is:
I am using react-native FlatList in Today.js page
export default class TodayView extends Component {
constructor(props, context) {
super(props, context);
}
render() {
return (
Welcome to Today View
<FlatList
data={[
{ key: 'Devin' },
{ key: 'Jackson' },
{ key: 'James' },
{ key: 'Joel' },
{ key: 'John' },
{ key: 'Jillian' },
{ key: 'Jimmy' },
{ key: 'Julie' },
{ key: 'John' },
{ key: 'Jillian' },
{ key: 'Jimmy' },
{ key: 'Dinesh' },
]}
renderItem={({ item }) => <Text style={{padding : 50}}>{item.key}}
/>
);
}
};