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

Add indicator container style #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
25 changes: 13 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,19 @@ class Example extends Component {

## Properties

name | description | type | default
:----------------- |:-------------------------------------- | --------:|:------------------
horizontal | Scroll direction | Boolean | true
rtl | RTL mode for horizontal scroll | Boolean | false
startPage | Start page | Number | 0
indicatorColor | Page indicator color | String | rgb(255, 255, 255)
indicatorOpacity | Page indicator opacity (inactive dots) | Number | 0.30
indicatorPosition | Page indicator position | String | bottom
containerStyle | Style for container view | Object | -
progress | Animated.Value updated with progress | Object | -
onScrollEnd | Scroll end callback | Function | -
renderPager | Render pager callback | Function | -
name | description | type | default
:-----------------------|:-------------------------------------- | --------:|:------------------
horizontal | Scroll direction | Boolean | true
rtl | RTL mode for horizontal scroll | Boolean | false
startPage | Start page | Number | 0
indicatorColor | Page indicator color | String | rgb(255, 255, 255)
indicatorOpacity | Page indicator opacity (inactive dots) | Number | 0.30
indicatorPosition | Page indicator position | String | bottom
indicatorContainerStyle| Indicator container style | Object |

Choose a reason for hiding this comment

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

how to use and example?

containerStyle | Style for container view | Object | -
progress | Animated.Value updated with progress | Object | -
onScrollEnd | Scroll end callback | Function | -
renderPager | Render pager callback | Function | -

Possible values for `indicatorPosition` are `none`, `top`, `right`, `bottom` and `left`

Expand Down
5 changes: 3 additions & 2 deletions src/components/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default class Pages extends PureComponent {
style: ViewPropTypes.style,
containerStyle: ViewPropTypes.style,

indicatorContainerStyle: ViewPropTypes.style,
indicatorColor: PropTypes.string,
indicatorOpacity: PropTypes.number,
indicatorPosition: PropTypes.oneOf([
Expand Down Expand Up @@ -213,7 +214,7 @@ export default class Pages extends PureComponent {
}

renderPager(pager) {
let { renderPager, horizontal, rtl } = this.props;
let { renderPager, horizontal, rtl, indicatorContainerStyle } = this.props;

if ('function' === typeof renderPager) {
return renderPager({ horizontal, rtl, ...pager });
Expand All @@ -230,7 +231,7 @@ export default class Pages extends PureComponent {
null;

return (
<View style={[styles[indicatorPosition], indicatorStyle]}>
<View style={[styles[indicatorPosition], indicatorStyle, indicatorContainerStyle]}>
<Indicator {...pager} />
</View>
);
Expand Down