diff --git a/AppIntro.js b/AppIntro.js index 52b42d9..5d41738 100644 --- a/AppIntro.js +++ b/AppIntro.js @@ -19,7 +19,7 @@ import RenderDots from './components/Dots'; const windowsWidth = Dimensions.get('window').width; const windowsHeight = Dimensions.get('window').height; -const defaulStyles = { +const defaultStyles = { header: { flex: 0.5, justifyContent: 'center', @@ -108,7 +108,7 @@ export default class AppIntro extends Component { constructor(props) { super(props); - this.styles = StyleSheet.create(assign({}, defaulStyles, props.customStyles)); + this.styles = StyleSheet.create(assign({}, defaultStyles, props.customStyles)); this.state = { skipFadeOpacity: new Animated.Value(1), @@ -388,6 +388,8 @@ AppIntro.propTypes = { showSkipButton: PropTypes.bool, showDoneButton: PropTypes.bool, showDots: PropTypes.bool, + allowFontScaling: PropTypes.bool, + fontSize: PropTypes.number }; AppIntro.defaultProps = { @@ -407,4 +409,6 @@ AppIntro.defaultProps = { showSkipButton: true, showDoneButton: true, showDots: true + allowFontScaling: true, + fontSize: 22 }; diff --git a/README.md b/README.md index d0829de..1e2c876 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,8 @@ And in Android, image inside view component, view need width、height. | showSkipButton | bool | true | a boolean defining if we should render the skip button | | showDoneButton | bool | true | a boolean that defines if we should render the done button | | showDots | bool | true | a boolean that defines if we should render the bottom dots | +| allowFontScaling | bool | true | a boolean that defines if we should allow font scaling on devices with larger text sizes enabled | +| fontSize | number | 22 | a number that specifies the size of the Skip, Done, and Next labels | ##### **Children View Properties** | Prop | PropType | Default Value | Description | diff --git a/components/DoneButton.android.js b/components/DoneButton.android.js index ae7890e..559e186 100644 --- a/components/DoneButton.android.js +++ b/components/DoneButton.android.js @@ -9,13 +9,14 @@ export const DoneButton = ({ styles, onDoneBtnClick, onNextBtnClick, rightTextColor, isDoneBtnShow, doneBtnLabel, nextBtnLabel, + allowFontScaling, fontSize }) => { return ( - + {isDoneBtnShow ? doneBtnLabel : nextBtnLabel} diff --git a/components/DoneButton.ios.js b/components/DoneButton.ios.js index a6d2c9e..c63b61c 100644 --- a/components/DoneButton.ios.js +++ b/components/DoneButton.ios.js @@ -10,7 +10,8 @@ export const DoneButton = ({ styles, onDoneBtnClick, onNextBtnClick, rightTextColor, isDoneBtnShow, doneBtnLabel, nextBtnLabel, - doneFadeOpacity, skipFadeOpacity, nextOpacity + doneFadeOpacity, skipFadeOpacity, nextOpacity, + allowFontScaling, fontSize }) => { return ( @@ -25,8 +26,8 @@ export const DoneButton = ({ }]} > - {doneBtnLabel} @@ -35,7 +36,7 @@ export const DoneButton = ({ - + {nextBtnLabel} @@ -45,4 +46,3 @@ export const DoneButton = ({ } export default DoneButton - \ No newline at end of file diff --git a/components/SkipButton.android.js b/components/SkipButton.android.js index 2787745..66dc30c 100644 --- a/components/SkipButton.android.js +++ b/components/SkipButton.android.js @@ -10,7 +10,9 @@ export const SkipButton = ({ styles, onSkipBtnClick, isSkipBtnShow, leftTextColor, skipBtnLabel, - skipFadeOpacity + skipFadeOpacity, + allowFontScaling, + fontSize }) => { return ( onSkipBtnClick() : null}> - + {skipBtnLabel} diff --git a/components/SkipButton.ios.js b/components/SkipButton.ios.js index d182d91..8a7cd1c 100644 --- a/components/SkipButton.ios.js +++ b/components/SkipButton.ios.js @@ -10,7 +10,8 @@ export const SkipButton = ({ styles, onSkipBtnClick, isSkipBtnShow, leftTextColor, skipBtnLabel, - skipFadeOpacity + skipFadeOpacity, + allowFontScaling, fontSize }) => { return ( onSkipBtnClick() : null}> - + {skipBtnLabel}