From 62ea5551e5379fe5db276e8076cea12204c21dbe Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 16:59:33 -0600 Subject: [PATCH 1/6] Add allowFontScaling & fontSize props - fix typo for defaultStyles --- AppIntro.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AppIntro.js b/AppIntro.js index 52b42d9..9e2397f 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,5 @@ AppIntro.defaultProps = { showSkipButton: true, showDoneButton: true, showDots: true + allowFontScaling: true }; From 1bc07ad2e933b69c98785aa2e1bf74e85236f01b Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 17:04:04 -0600 Subject: [PATCH 2/6] Add allowFontScaling & fontSize props to Done button --- components/DoneButton.android.js | 3 ++- components/DoneButton.ios.js | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) 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 From da91a7af92eb88607e83cce9789fad8809eca2c5 Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 17:04:28 -0600 Subject: [PATCH 3/6] Add allowFontScaling & fontSize props to Skip button --- components/SkipButton.android.js | 6 ++++-- components/SkipButton.ios.js | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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} From 5842383db0c1da4fb92663fd6b482bd134f0b407 Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 17:14:23 -0600 Subject: [PATCH 4/6] Add defaut fontSize --- AppIntro.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AppIntro.js b/AppIntro.js index 9e2397f..5d41738 100644 --- a/AppIntro.js +++ b/AppIntro.js @@ -409,5 +409,6 @@ AppIntro.defaultProps = { showSkipButton: true, showDoneButton: true, showDots: true - allowFontScaling: true + allowFontScaling: true, + fontSize: 22 }; From 866544cd2ddb5c38d0168ff9e49e2f105eff59fb Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 17:21:23 -0600 Subject: [PATCH 5/6] Update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d0829de..eff3f4a 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,9 @@ And in Android, image inside view component, view need width、height. | 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 | |-------|----------|---------------|-----------------------| From 2e250c8e4a9933d0a6674c87359d88b0c5cff3bf Mon Sep 17 00:00:00 2001 From: fvonhoven Date: Thu, 1 Dec 2016 17:21:59 -0600 Subject: [PATCH 6/6] Fix typo --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index eff3f4a..1e2c876 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,6 @@ 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 |