Skip to content
Merged
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
14 changes: 9 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface IDotContainerProps {
sizeRatio?:number;
activeDotColor:string;
vertical?:boolean;
activeStyle?: ViewStyle
inActiveStyle?: ViewStyle
}

const ONE_EMPTY_DOT_SIZE = defaultEmptyDotSize * defaultEmptyDotSize;
Expand All @@ -37,7 +39,7 @@ class DotContainer extends React.Component<IDotContainerProps>{
}

render () {
const { curPage, maxPage, activeDotColor } = this.props;
const { curPage, maxPage, activeDotColor, activeStyle, inActiveStyle } = this.props;
const list = [ ...Array(maxPage).keys() ];


Expand Down Expand Up @@ -65,6 +67,7 @@ class DotContainer extends React.Component<IDotContainerProps>{
curPage={ normalizedPage }
maxPage={ maxPage }
activeColor={activeDotColor}
activeStyle={activeStyle}
/>
);
}) }
Expand Down Expand Up @@ -93,8 +96,8 @@ class DotContainer extends React.Component<IDotContainerProps>{
showsHorizontalScrollIndicator={ false }>

{/* previous empty dummy dot */}
<EmptyDot sizeRatio={sizeRatio} />
<EmptyDot sizeRatio={sizeRatio} />
<EmptyDot sizeRatio={sizeRatio} inActiveStyle={inActiveStyle} />
<EmptyDot sizeRatio={sizeRatio} inActiveStyle={inActiveStyle} />


{ list.map(i => {
Expand All @@ -106,13 +109,14 @@ class DotContainer extends React.Component<IDotContainerProps>{
curPage={ normalizedPage }
maxPage={ maxPage }
activeColor={activeDotColor}
activeStyle={activeStyle}
/>
);
}) }

{/* previous empty dummy dot */}
<EmptyDot sizeRatio={sizeRatio} />
<EmptyDot sizeRatio={sizeRatio} />
<EmptyDot sizeRatio={sizeRatio} inActiveStyle={inActiveStyle} />
<EmptyDot sizeRatio={sizeRatio} inActiveStyle={inActiveStyle} />

</ScrollView>
</View>
Expand Down