├── .editorconfig ├── .eslintrc ├── .github └── FUNDING.yml ├── .gitignore ├── .npmignore ├── .prettierrc ├── .travis.yml ├── Bar.js ├── Circle.js ├── CircleSnail.js ├── Example ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── Example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Example.xcscheme │ ├── Example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ ├── ExampleTests │ │ ├── ExampleTests.m │ │ └── Info.plist │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json └── yarn.lock ├── LICENSE ├── Pie.js ├── README.md ├── Shapes ├── Arc.js ├── Circle.js └── Sector.js ├── index.d.ts ├── index.js ├── package.json ├── withAnimation.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "airbnb", 4 | "prettier", 5 | "prettier/flowtype", 6 | "prettier/react" 7 | ], 8 | "plugins": [ 9 | "prettier" 10 | ], 11 | "parser": "babel-eslint", 12 | "rules": { 13 | "react/forbid-prop-types": [0], 14 | "react/destructuring-assignment": [0], 15 | "react/require-default-props": [0], 16 | "react/default-props-match-prop-types": [0], 17 | "react/prefer-stateless-function": [0], 18 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], 19 | "import/no-extraneous-dependencies": [0], 20 | "import/no-unresolved": [2, { ignore: ['^react(-native)?$'] }], 21 | "import/extensions": [2, { "js": "never", "json": "always" }], 22 | "operator-assignment": [0] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [oblador] 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | *.log 3 | 4 | # Dependency directory 5 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 6 | node_modules 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.log 2 | node_modules 3 | Example 4 | .DS_Store 5 | .editorconfig 6 | .eslintrc 7 | .travis.yml 8 | .prettierrc 9 | yarn.lock 10 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5" 4 | } 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - stable 4 | cache: 5 | yarn: true 6 | directories: 7 | - node_modules 8 | install: 9 | - yarn 10 | script: 11 | - yarn test 12 | deploy: 13 | provider: npm 14 | email: joel@oblador.se 15 | api_key: 16 | secure: "KETX2hAy9M6jDWctTKZX7osMzvkH3goD3dmoK9x+s0UnUEDmppk1Qoj+HP3rDs5foLBP7bXdFKsMxBo91MFy+816c5+rAcR7y6mIaaHIcfsTB2sxFwAL43ikJ9hffb58IrgqHPr0Ns64e6CUXqGe60F1CADLoDfYl2Yd3HZOuKLVlBqCEqLuHAFVPB7ollhFgnhhEOJKr2BaxqbUJmvgSHuqdLwwmj9O2/1sADhLI2iF/rnEDDlKiHM1mzkfcvbUKsAKyElCvzRhTAsbyBfzstpen28ln2HIEGi4mNsWdvXENyFIxv2UMKque/d0PQR/A+axrn+O4vrXNUAcPe1qcQfITYH8MbM92iPdFmpFarQGV+lAsE0Uy+7OHKYe4/oHHvIE7S3qsZEesZWFc4MUacaE9FbrtxV6YYmVAo+fN5Cq2iFCerr/jiZTfusq9Txmj3PX7+IImeYAk4ssCxTUtkgMgacSDT1626zect71SpJZy1a/QrwHYs28gd97vfGs6UsZGWge/ogS3IUrnJ5fxFlv90+Y/q8ntAdbCa7HUYXEmkFPN9CeOaom31DbbWhjgBK0uUrCrq56cM3adFlHl60plIB/72kQPsTgHOIu1Ei3jZp8MFdhOnK+KJlflhZNi5+3p3u0UOX5flvlx8WCy/a4YEUAa8m7ma43V8JKfNI=" 17 | on: 18 | tags: true 19 | repo: oblador/react-native-progress 20 | condition: "$TRAVIS_TAG =~ ^v[0-9]+\\.[0-9]+\\.[0-9]+.*$" 21 | -------------------------------------------------------------------------------- /Bar.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Animated, Easing, View, I18nManager } from 'react-native'; 4 | 5 | const INDETERMINATE_WIDTH_FACTOR = 0.3; 6 | const BAR_WIDTH_ZERO_POSITION = 7 | INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR); 8 | 9 | export default class ProgressBar extends Component { 10 | static propTypes = { 11 | animated: PropTypes.bool, 12 | borderColor: PropTypes.string, 13 | borderRadius: PropTypes.number, 14 | borderWidth: PropTypes.number, 15 | children: PropTypes.node, 16 | color: PropTypes.string, 17 | height: PropTypes.number, 18 | indeterminate: PropTypes.bool, 19 | indeterminateAnimationDuration: PropTypes.number, 20 | onLayout: PropTypes.func, 21 | progress: PropTypes.number, 22 | style: PropTypes.any, 23 | unfilledColor: PropTypes.string, 24 | width: PropTypes.number, 25 | useNativeDriver: PropTypes.bool, 26 | animationConfig: PropTypes.object, 27 | animationType: PropTypes.oneOf(['decay', 'timing', 'spring']), 28 | }; 29 | 30 | static defaultProps = { 31 | animated: true, 32 | borderRadius: 4, 33 | borderWidth: 1, 34 | color: 'rgba(0, 122, 255, 1)', 35 | height: 6, 36 | indeterminate: false, 37 | indeterminateAnimationDuration: 1000, 38 | progress: 0, 39 | width: 150, 40 | useNativeDriver: false, 41 | animationConfig: { bounciness: 0 }, 42 | animationType: 'spring', 43 | }; 44 | 45 | constructor(props) { 46 | super(props); 47 | const progress = Math.min(Math.max(props.progress, 0), 1); 48 | this.state = { 49 | width: 0, 50 | progress: new Animated.Value( 51 | props.indeterminate ? INDETERMINATE_WIDTH_FACTOR : progress 52 | ), 53 | animationValue: new Animated.Value(BAR_WIDTH_ZERO_POSITION), 54 | }; 55 | } 56 | 57 | componentDidMount() { 58 | if (this.props.indeterminate) { 59 | this.animate(); 60 | } 61 | } 62 | 63 | componentDidUpdate(prevProps) { 64 | if (prevProps.indeterminate !== this.props.indeterminate) { 65 | if (this.props.indeterminate) { 66 | this.animate(); 67 | } else { 68 | Animated.spring(this.state.animationValue, { 69 | toValue: BAR_WIDTH_ZERO_POSITION, 70 | useNativeDriver: this.props.useNativeDriver, 71 | }).start(); 72 | } 73 | } 74 | if ( 75 | prevProps.indeterminate !== this.props.indeterminate || 76 | prevProps.progress !== this.props.progress 77 | ) { 78 | const progress = this.props.indeterminate 79 | ? INDETERMINATE_WIDTH_FACTOR 80 | : Math.min(Math.max(this.props.progress, 0), 1); 81 | 82 | if (this.props.animated) { 83 | const { animationType, animationConfig } = this.props; 84 | Animated[animationType](this.state.progress, { 85 | ...animationConfig, 86 | toValue: progress, 87 | useNativeDriver: this.props.useNativeDriver, 88 | }).start(); 89 | } else { 90 | this.state.progress.setValue(progress); 91 | } 92 | } 93 | } 94 | 95 | handleLayout = event => { 96 | if (!this.props.width) { 97 | this.setState({ width: event.nativeEvent.layout.width }); 98 | } 99 | if (this.props.onLayout) { 100 | this.props.onLayout(event); 101 | } 102 | }; 103 | 104 | animate() { 105 | this.state.animationValue.setValue(0); 106 | Animated.timing(this.state.animationValue, { 107 | toValue: 1, 108 | duration: this.props.indeterminateAnimationDuration, 109 | easing: Easing.linear, 110 | isInteraction: false, 111 | useNativeDriver: this.props.useNativeDriver, 112 | }).start(endState => { 113 | if (endState.finished) { 114 | this.animate(); 115 | } 116 | }); 117 | } 118 | 119 | render() { 120 | const { 121 | borderColor, 122 | borderRadius, 123 | borderWidth, 124 | children, 125 | color, 126 | height, 127 | style, 128 | unfilledColor, 129 | width, 130 | ...restProps 131 | } = this.props; 132 | 133 | const innerWidth = Math.max(0, width || this.state.width) - borderWidth * 2; 134 | const containerStyle = { 135 | width, 136 | borderWidth, 137 | borderColor: borderColor || color, 138 | borderRadius, 139 | overflow: 'hidden', 140 | backgroundColor: unfilledColor, 141 | }; 142 | const progressStyle = { 143 | backgroundColor: color, 144 | height, 145 | transform: [ 146 | { 147 | translateX: this.state.animationValue.interpolate({ 148 | inputRange: [0, 1], 149 | outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth], 150 | }), 151 | }, 152 | { 153 | translateX: this.state.progress.interpolate({ 154 | inputRange: [0, 1], 155 | outputRange: [innerWidth / (I18nManager.isRTL ? 2 : -2), 0], 156 | }), 157 | }, 158 | { 159 | // Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278 160 | scaleX: this.state.progress.interpolate({ 161 | inputRange: [0, 1], 162 | outputRange: [0.0001, 1], 163 | }), 164 | }, 165 | ], 166 | }; 167 | 168 | return ( 169 | 174 | 175 | {children} 176 | 177 | ); 178 | } 179 | } -------------------------------------------------------------------------------- /Circle.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Animated, StyleSheet, Text, View } from 'react-native'; 4 | import { Svg } from 'react-native-svg'; 5 | 6 | import Arc from './Shapes/Arc'; 7 | import withAnimation from './withAnimation'; 8 | 9 | const CIRCLE = Math.PI * 2; 10 | 11 | const AnimatedSvg = Animated.createAnimatedComponent(Svg); 12 | const AnimatedArc = Animated.createAnimatedComponent(Arc); 13 | 14 | const styles = StyleSheet.create({ 15 | container: { 16 | backgroundColor: 'transparent', 17 | overflow: 'hidden', 18 | }, 19 | }); 20 | 21 | export class ProgressCircle extends Component { 22 | static propTypes = { 23 | animated: PropTypes.bool, 24 | borderColor: PropTypes.string, 25 | borderWidth: PropTypes.number, 26 | color: PropTypes.string, 27 | children: PropTypes.node, 28 | direction: PropTypes.oneOf(['clockwise', 'counter-clockwise']), 29 | fill: PropTypes.string, 30 | formatText: PropTypes.func, 31 | indeterminate: PropTypes.bool, 32 | progress: PropTypes.oneOfType([ 33 | PropTypes.number, 34 | PropTypes.instanceOf(Animated.Value), 35 | ]), 36 | rotation: PropTypes.instanceOf(Animated.Value), 37 | showsText: PropTypes.bool, 38 | size: PropTypes.number, 39 | style: PropTypes.any, 40 | strokeCap: PropTypes.oneOf(['butt', 'square', 'round']), 41 | textStyle: PropTypes.any, 42 | thickness: PropTypes.number, 43 | unfilledColor: PropTypes.string, 44 | endAngle: PropTypes.number, 45 | allowFontScaling: PropTypes.bool, 46 | }; 47 | 48 | static defaultProps = { 49 | borderWidth: 1, 50 | color: 'rgba(0, 122, 255, 1)', 51 | direction: 'clockwise', 52 | formatText: progress => `${Math.round(progress * 100)}%`, 53 | progress: 0, 54 | showsText: false, 55 | size: 40, 56 | thickness: 3, 57 | endAngle: 0.9, 58 | allowFontScaling: true, 59 | }; 60 | 61 | constructor(props, context) { 62 | super(props, context); 63 | 64 | this.progressValue = 0; 65 | } 66 | 67 | componentDidMount() { 68 | if (this.props.animated) { 69 | this.props.progress.addListener(event => { 70 | this.progressValue = event.value; 71 | if (this.props.showsText || this.progressValue === 1) { 72 | this.forceUpdate(); 73 | } 74 | }); 75 | } 76 | } 77 | 78 | render() { 79 | const { 80 | animated, 81 | borderColor, 82 | borderWidth, 83 | color, 84 | children, 85 | direction, 86 | fill, 87 | formatText, 88 | indeterminate, 89 | progress, 90 | rotation, 91 | showsText, 92 | size, 93 | style, 94 | strokeCap, 95 | textStyle, 96 | thickness, 97 | unfilledColor, 98 | endAngle, 99 | allowFontScaling, 100 | ...restProps 101 | } = this.props; 102 | 103 | const border = borderWidth || (indeterminate ? 1 : 0); 104 | 105 | const radius = size / 2 - border; 106 | const offset = { 107 | top: border, 108 | left: border, 109 | }; 110 | const textOffset = border + thickness; 111 | const textSize = size - textOffset * 2; 112 | 113 | const Surface = rotation ? AnimatedSvg : Svg; 114 | const Shape = animated ? AnimatedArc : Arc; 115 | const progressValue = animated ? this.progressValue : progress; 116 | const angle = animated 117 | ? Animated.multiply(progress, CIRCLE) 118 | : progress * CIRCLE; 119 | 120 | return ( 121 | 122 | 141 | {unfilledColor && progressValue !== 1 ? ( 142 | 152 | ) : ( 153 | false 154 | )} 155 | {!indeterminate ? ( 156 | 167 | ) : ( 168 | false 169 | )} 170 | {border ? ( 171 | 179 | ) : ( 180 | false 181 | )} 182 | 183 | {!indeterminate && showsText ? ( 184 | 196 | 207 | {formatText(progressValue)} 208 | 209 | 210 | ) : ( 211 | false 212 | )} 213 | {children} 214 | 215 | ); 216 | } 217 | } 218 | 219 | export default withAnimation(ProgressCircle); 220 | -------------------------------------------------------------------------------- /CircleSnail.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Animated, Easing } from 'react-native'; 4 | import { Svg } from 'react-native-svg'; 5 | 6 | import Arc from './Shapes/Arc'; 7 | 8 | const AnimatedArc = Animated.createAnimatedComponent(Arc); 9 | 10 | const MIN_ARC_ANGLE = 0.1; 11 | const MAX_ARC_ANGLE = 1.5 * Math.PI; 12 | 13 | export default class CircleSnail extends Component { 14 | static propTypes = { 15 | animating: PropTypes.bool, 16 | color: PropTypes.oneOfType([ 17 | PropTypes.string, 18 | PropTypes.arrayOf(PropTypes.string), 19 | ]), 20 | children: PropTypes.node, 21 | direction: PropTypes.oneOf(['clockwise', 'counter-clockwise']), 22 | duration: PropTypes.number, 23 | hidesWhenStopped: PropTypes.bool, 24 | size: PropTypes.number, 25 | spinDuration: PropTypes.number, 26 | style: PropTypes.any, 27 | thickness: PropTypes.number, 28 | strokeCap: PropTypes.string, 29 | useNativeDriver: PropTypes.bool, 30 | }; 31 | 32 | static defaultProps = { 33 | animating: true, 34 | color: 'rgba(0, 122, 255, 1)', 35 | direction: 'counter-clockwise', 36 | hidesWhenStopped: false, 37 | size: 40, 38 | thickness: 3, 39 | strokeCap: 'round', 40 | useNativeDriver: false, 41 | }; 42 | 43 | constructor(props) { 44 | super(props); 45 | 46 | this.state = { 47 | startAngle: new Animated.Value(-MIN_ARC_ANGLE), 48 | endAngle: new Animated.Value(0), 49 | rotation: new Animated.Value(0), 50 | colorIndex: 0, 51 | }; 52 | } 53 | 54 | componentDidMount() { 55 | if (this.props.animating) { 56 | this.animate(); 57 | this.spin(); 58 | } 59 | } 60 | 61 | componentDidUpdate(prevProps) { 62 | if (prevProps.animating !== this.props.animating) { 63 | if (this.props.animating) { 64 | this.animate(); 65 | this.spin(); 66 | } else { 67 | this.stopAnimations(); 68 | } 69 | } 70 | } 71 | 72 | animate(iteration = 1) { 73 | Animated.sequence([ 74 | Animated.timing(this.state.startAngle, { 75 | toValue: -MAX_ARC_ANGLE * iteration - MIN_ARC_ANGLE, 76 | duration: this.props.duration || 1000, 77 | isInteraction: false, 78 | easing: Easing.inOut(Easing.quad), 79 | useNativeDriver: this.props.useNativeDriver, 80 | }), 81 | Animated.timing(this.state.endAngle, { 82 | toValue: -MAX_ARC_ANGLE * iteration, 83 | duration: this.props.duration || 1000, 84 | isInteraction: false, 85 | easing: Easing.inOut(Easing.quad), 86 | useNativeDriver: this.props.useNativeDriver, 87 | }), 88 | ]).start(endState => { 89 | if (endState.finished) { 90 | if (Array.isArray(this.props.color)) { 91 | this.setState({ 92 | colorIndex: iteration % this.props.color.length, 93 | }); 94 | } 95 | this.animate(iteration + 1); 96 | } 97 | }); 98 | } 99 | 100 | spin() { 101 | Animated.timing(this.state.rotation, { 102 | toValue: 1, 103 | duration: this.props.spinDuration || 5000, 104 | easing: Easing.linear, 105 | isInteraction: false, 106 | useNativeDriver: this.props.useNativeDriver, 107 | }).start(endState => { 108 | if (endState.finished) { 109 | this.state.rotation.setValue(0); 110 | this.spin(); 111 | } 112 | }); 113 | } 114 | 115 | stopAnimations() { 116 | this.state.startAngle.stopAnimation(); 117 | this.state.endAngle.stopAnimation(); 118 | this.state.rotation.stopAnimation(); 119 | } 120 | 121 | render() { 122 | const { 123 | animating, 124 | children, 125 | color, 126 | direction, 127 | hidesWhenStopped, 128 | size, 129 | style, 130 | thickness, 131 | strokeCap, 132 | ...restProps 133 | } = this.props; 134 | 135 | if (!animating && hidesWhenStopped) { 136 | return null; 137 | } 138 | 139 | const radius = size / 2 - thickness; 140 | const offset = { 141 | top: thickness, 142 | left: thickness, 143 | }; 144 | 145 | const directionFactor = direction === 'counter-clockwise' ? -1 : 1; 146 | 147 | return ( 148 | 166 | 167 | 181 | 182 | {children} 183 | 184 | ); 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | esproposal.optional_chaining=enable 27 | esproposal.nullish_coalescing=enable 28 | 29 | exact_by_default=true 30 | 31 | module.file_ext=.js 32 | module.file_ext=.json 33 | module.file_ext=.ios.js 34 | 35 | munge_underscores=true 36 | 37 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 38 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 39 | 40 | suppress_type=$FlowIssue 41 | suppress_type=$FlowFixMe 42 | suppress_type=$FlowFixMeProps 43 | suppress_type=$FlowFixMeState 44 | 45 | [lints] 46 | sketchy-null-number=warn 47 | sketchy-null-mixed=warn 48 | sketchy-number=warn 49 | untyped-type-import=warn 50 | nonstrict-import=warn 51 | deprecated-type=warn 52 | unsafe-getters-setters=warn 53 | unnecessary-invariant=warn 54 | signature-verification-failure=warn 55 | 56 | [strict] 57 | deprecated-type 58 | nonstrict-import 59 | sketchy-null 60 | unclear-type 61 | unsafe-getters-setters 62 | untyped-import 63 | untyped-type-import 64 | 65 | [version] 66 | ^0.137.0 67 | -------------------------------------------------------------------------------- /Example/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /Example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { StyleSheet, Text, View } from 'react-native'; 3 | import * as Progress from 'react-native-progress'; 4 | 5 | const styles = StyleSheet.create({ 6 | container: { 7 | flex: 1, 8 | justifyContent: 'center', 9 | alignItems: 'center', 10 | backgroundColor: '#fff', 11 | paddingVertical: 20, 12 | }, 13 | welcome: { 14 | fontSize: 20, 15 | textAlign: 'center', 16 | margin: 10, 17 | }, 18 | circles: { 19 | flexDirection: 'row', 20 | alignItems: 'center', 21 | }, 22 | progress: { 23 | margin: 10, 24 | }, 25 | }); 26 | 27 | export default class Example extends Component { 28 | constructor(props) { 29 | super(props); 30 | 31 | this.state = { 32 | progress: 0, 33 | indeterminate: true, 34 | }; 35 | } 36 | 37 | componentDidMount() { 38 | this.animate(); 39 | } 40 | 41 | animate() { 42 | let progress = 0; 43 | this.setState({ progress }); 44 | setTimeout(() => { 45 | this.setState({ indeterminate: false }); 46 | setInterval(() => { 47 | progress += Math.random() / 5; 48 | if (progress > 1) { 49 | progress = 1; 50 | } 51 | this.setState({ progress }); 52 | }, 500); 53 | }, 1500); 54 | } 55 | 56 | render() { 57 | return ( 58 | 59 | Progress Example 60 | 65 | 66 | 71 | 76 | 82 | 83 | 84 | 85 | 89 | 90 | 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /Example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /Example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and mirrored here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | android { 124 | ndkVersion rootProject.ext.ndkVersion 125 | 126 | compileSdkVersion rootProject.ext.compileSdkVersion 127 | 128 | compileOptions { 129 | sourceCompatibility JavaVersion.VERSION_1_8 130 | targetCompatibility JavaVersion.VERSION_1_8 131 | } 132 | 133 | defaultConfig { 134 | applicationId "com.example" 135 | minSdkVersion rootProject.ext.minSdkVersion 136 | targetSdkVersion rootProject.ext.targetSdkVersion 137 | versionCode 1 138 | versionName "1.0" 139 | } 140 | splits { 141 | abi { 142 | reset() 143 | enable enableSeparateBuildPerCPUArchitecture 144 | universalApk false // If true, also generate a universal APK 145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 146 | } 147 | } 148 | signingConfigs { 149 | debug { 150 | storeFile file('debug.keystore') 151 | storePassword 'android' 152 | keyAlias 'androiddebugkey' 153 | keyPassword 'android' 154 | } 155 | } 156 | buildTypes { 157 | debug { 158 | signingConfig signingConfigs.debug 159 | } 160 | release { 161 | // Caution! In production, you need to generate your own keystore file. 162 | // see https://reactnative.dev/docs/signed-apk-android. 163 | signingConfig signingConfigs.debug 164 | minifyEnabled enableProguardInReleaseBuilds 165 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 166 | } 167 | } 168 | 169 | // applicationVariants are e.g. debug, release 170 | applicationVariants.all { variant -> 171 | variant.outputs.each { output -> 172 | // For each separate APK per architecture, set a unique version code as described here: 173 | // https://developer.android.com/studio/build/configure-apk-splits.html 174 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 175 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 176 | def abi = output.getFilter(OutputFile.ABI) 177 | if (abi != null) { // null for the universal-debug, universal-release variants 178 | output.versionCodeOverride = 179 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 180 | } 181 | 182 | } 183 | } 184 | } 185 | 186 | dependencies { 187 | implementation fileTree(dir: "libs", include: ["*.jar"]) 188 | //noinspection GradleDynamicVersion 189 | implementation "com.facebook.react:react-native:+" // From node_modules 190 | 191 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 192 | 193 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 194 | exclude group:'com.facebook.fbjni' 195 | } 196 | 197 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 198 | exclude group:'com.facebook.flipper' 199 | exclude group:'com.squareup.okhttp3', module:'okhttp' 200 | } 201 | 202 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 203 | exclude group:'com.facebook.flipper' 204 | } 205 | 206 | if (enableHermes) { 207 | def hermesPath = "../../node_modules/hermes-engine/android/"; 208 | debugImplementation files(hermesPath + "hermes-debug.aar") 209 | releaseImplementation files(hermesPath + "hermes-release.aar") 210 | } else { 211 | implementation jscFlavor 212 | } 213 | } 214 | 215 | // Run this once to be able to run the application with BUCK 216 | // puts all compile dependencies into folder libs for BUCK to use 217 | task copyDownloadableDepsToLibs(type: Copy) { 218 | from configurations.compile 219 | into 'libs' 220 | } 221 | 222 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 223 | -------------------------------------------------------------------------------- /Example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /Example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/debug.keystore -------------------------------------------------------------------------------- /Example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /Example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Example/android/app/src/debug/java/com/example/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.example; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "Example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.example.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Example 3 | 4 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "29.0.3" 6 | minSdkVersion = 21 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | ndkVersion = "20.1.5948944" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath("com.android.tools.build:gradle:4.1.0") 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.75.1 29 | -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluesky-social/react-native-progress/5a372f4f2ce5feb26f4f47b6a4d187ab9b923ab4/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /Example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /Example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /Example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /Example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "displayName": "Example" 4 | } -------------------------------------------------------------------------------- /Example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /Example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleTests.m */; }; 11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 15 | CB7A3FF9427DEB35A10D9804 /* libPods-Example-ExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 43462D9E817DAEFBC9C1E905 /* libPods-Example-ExampleTests.a */; }; 16 | E36E162DDFCE6DB030FB9A60 /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A010FEF90BBA35C16083016C /* libPods-Example.a */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 25 | remoteInfo = Example; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 00E356F21AD99517003FC87E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; }; 33 | 13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Example/AppDelegate.h; sourceTree = ""; }; 35 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Example/AppDelegate.m; sourceTree = ""; }; 36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = ""; }; 37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; }; 38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Example/main.m; sourceTree = ""; }; 39 | 285A55555794D9F79494EDAA /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 40 | 43462D9E817DAEFBC9C1E905 /* libPods-Example-ExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-ExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 49B47AE0E62B61C1A4BC0A3F /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 42 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Example/LaunchScreen.storyboard; sourceTree = ""; }; 43 | A010FEF90BBA35C16083016C /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | B0107D1C097D10D527B5EC66 /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = ""; }; 45 | C9273720021329D22AEB5B09 /* Pods-Example-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig"; sourceTree = ""; }; 46 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | CB7A3FF9427DEB35A10D9804 /* libPods-Example-ExampleTests.a in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | E36E162DDFCE6DB030FB9A60 /* libPods-Example.a in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 00E356EF1AD99517003FC87E /* ExampleTests */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 00E356F21AD99517003FC87E /* ExampleTests.m */, 73 | 00E356F01AD99517003FC87E /* Supporting Files */, 74 | ); 75 | path = ExampleTests; 76 | sourceTree = ""; 77 | }; 78 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 00E356F11AD99517003FC87E /* Info.plist */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 13B07FAE1A68108700A75B9A /* Example */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 90 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 91 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 92 | 13B07FB61A68108700A75B9A /* Info.plist */, 93 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 94 | 13B07FB71A68108700A75B9A /* main.m */, 95 | ); 96 | name = Example; 97 | sourceTree = ""; 98 | }; 99 | 2482C80C7C9DC9D2C7F1CAB6 /* Pods */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 285A55555794D9F79494EDAA /* Pods-Example.debug.xcconfig */, 103 | 49B47AE0E62B61C1A4BC0A3F /* Pods-Example.release.xcconfig */, 104 | B0107D1C097D10D527B5EC66 /* Pods-Example-ExampleTests.debug.xcconfig */, 105 | C9273720021329D22AEB5B09 /* Pods-Example-ExampleTests.release.xcconfig */, 106 | ); 107 | name = Pods; 108 | path = Pods; 109 | sourceTree = ""; 110 | }; 111 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 115 | A010FEF90BBA35C16083016C /* libPods-Example.a */, 116 | 43462D9E817DAEFBC9C1E905 /* libPods-Example-ExampleTests.a */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | ); 125 | name = Libraries; 126 | sourceTree = ""; 127 | }; 128 | 83CBB9F61A601CBA00E9B192 = { 129 | isa = PBXGroup; 130 | children = ( 131 | 13B07FAE1A68108700A75B9A /* Example */, 132 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 133 | 00E356EF1AD99517003FC87E /* ExampleTests */, 134 | 83CBBA001A601CBA00E9B192 /* Products */, 135 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 136 | 2482C80C7C9DC9D2C7F1CAB6 /* Pods */, 137 | ); 138 | indentWidth = 2; 139 | sourceTree = ""; 140 | tabWidth = 2; 141 | usesTabs = 0; 142 | }; 143 | 83CBBA001A601CBA00E9B192 /* Products */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 13B07F961A680F5B00A75B9A /* Example.app */, 147 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */, 148 | ); 149 | name = Products; 150 | sourceTree = ""; 151 | }; 152 | /* End PBXGroup section */ 153 | 154 | /* Begin PBXNativeTarget section */ 155 | 00E356ED1AD99517003FC87E /* ExampleTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */; 158 | buildPhases = ( 159 | 86CBD4E195A44BF2023D0B9E /* [CP] Check Pods Manifest.lock */, 160 | 00E356EA1AD99517003FC87E /* Sources */, 161 | 00E356EB1AD99517003FC87E /* Frameworks */, 162 | 00E356EC1AD99517003FC87E /* Resources */, 163 | ED2FB36351C5D47AD66B32D5 /* [CP] Embed Pods Frameworks */, 164 | DAAEC3DACDC7A54856FE4259 /* [CP] Copy Pods Resources */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 170 | ); 171 | name = ExampleTests; 172 | productName = ExampleTests; 173 | productReference = 00E356EE1AD99517003FC87E /* ExampleTests.xctest */; 174 | productType = "com.apple.product-type.bundle.unit-test"; 175 | }; 176 | 13B07F861A680F5B00A75B9A /* Example */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */; 179 | buildPhases = ( 180 | 6D15CB95A1DD8CDCA965C23E /* [CP] Check Pods Manifest.lock */, 181 | FD10A7F022414F080027D42C /* Start Packager */, 182 | 13B07F871A680F5B00A75B9A /* Sources */, 183 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 184 | 13B07F8E1A680F5B00A75B9A /* Resources */, 185 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 186 | F92415B56C073015A92B2AA0 /* [CP] Embed Pods Frameworks */, 187 | D221D6C8A72A648813AA000E /* [CP] Copy Pods Resources */, 188 | ); 189 | buildRules = ( 190 | ); 191 | dependencies = ( 192 | ); 193 | name = Example; 194 | productName = Example; 195 | productReference = 13B07F961A680F5B00A75B9A /* Example.app */; 196 | productType = "com.apple.product-type.application"; 197 | }; 198 | /* End PBXNativeTarget section */ 199 | 200 | /* Begin PBXProject section */ 201 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 202 | isa = PBXProject; 203 | attributes = { 204 | LastUpgradeCheck = 1210; 205 | TargetAttributes = { 206 | 00E356ED1AD99517003FC87E = { 207 | CreatedOnToolsVersion = 6.2; 208 | TestTargetID = 13B07F861A680F5B00A75B9A; 209 | }; 210 | 13B07F861A680F5B00A75B9A = { 211 | LastSwiftMigration = 1120; 212 | }; 213 | }; 214 | }; 215 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */; 216 | compatibilityVersion = "Xcode 12.0"; 217 | developmentRegion = en; 218 | hasScannedForEncodings = 0; 219 | knownRegions = ( 220 | en, 221 | Base, 222 | ); 223 | mainGroup = 83CBB9F61A601CBA00E9B192; 224 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 225 | projectDirPath = ""; 226 | projectRoot = ""; 227 | targets = ( 228 | 13B07F861A680F5B00A75B9A /* Example */, 229 | 00E356ED1AD99517003FC87E /* ExampleTests */, 230 | ); 231 | }; 232 | /* End PBXProject section */ 233 | 234 | /* Begin PBXResourcesBuildPhase section */ 235 | 00E356EC1AD99517003FC87E /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 247 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | /* End PBXResourcesBuildPhase section */ 252 | 253 | /* Begin PBXShellScriptBuildPhase section */ 254 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputPaths = ( 260 | ); 261 | name = "Bundle React Native code and images"; 262 | outputPaths = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | shellPath = /bin/sh; 266 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 267 | }; 268 | 6D15CB95A1DD8CDCA965C23E /* [CP] Check Pods Manifest.lock */ = { 269 | isa = PBXShellScriptBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | ); 273 | inputFileListPaths = ( 274 | ); 275 | inputPaths = ( 276 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 277 | "${PODS_ROOT}/Manifest.lock", 278 | ); 279 | name = "[CP] Check Pods Manifest.lock"; 280 | outputFileListPaths = ( 281 | ); 282 | outputPaths = ( 283 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | shellPath = /bin/sh; 287 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 288 | showEnvVarsInLog = 0; 289 | }; 290 | 86CBD4E195A44BF2023D0B9E /* [CP] Check Pods Manifest.lock */ = { 291 | isa = PBXShellScriptBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ); 295 | inputFileListPaths = ( 296 | ); 297 | inputPaths = ( 298 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 299 | "${PODS_ROOT}/Manifest.lock", 300 | ); 301 | name = "[CP] Check Pods Manifest.lock"; 302 | outputFileListPaths = ( 303 | ); 304 | outputPaths = ( 305 | "$(DERIVED_FILE_DIR)/Pods-Example-ExampleTests-checkManifestLockResult.txt", 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | shellPath = /bin/sh; 309 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 310 | showEnvVarsInLog = 0; 311 | }; 312 | D221D6C8A72A648813AA000E /* [CP] Copy Pods Resources */ = { 313 | isa = PBXShellScriptBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | inputFileListPaths = ( 318 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-input-files.xcfilelist", 319 | ); 320 | name = "[CP] Copy Pods Resources"; 321 | outputFileListPaths = ( 322 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-output-files.xcfilelist", 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | shellPath = /bin/sh; 326 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; 327 | showEnvVarsInLog = 0; 328 | }; 329 | DAAEC3DACDC7A54856FE4259 /* [CP] Copy Pods Resources */ = { 330 | isa = PBXShellScriptBuildPhase; 331 | buildActionMask = 2147483647; 332 | files = ( 333 | ); 334 | inputFileListPaths = ( 335 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", 336 | ); 337 | name = "[CP] Copy Pods Resources"; 338 | outputFileListPaths = ( 339 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | shellPath = /bin/sh; 343 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources.sh\"\n"; 344 | showEnvVarsInLog = 0; 345 | }; 346 | ED2FB36351C5D47AD66B32D5 /* [CP] Embed Pods Frameworks */ = { 347 | isa = PBXShellScriptBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | ); 351 | inputFileListPaths = ( 352 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 353 | ); 354 | name = "[CP] Embed Pods Frameworks"; 355 | outputFileListPaths = ( 356 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | shellPath = /bin/sh; 360 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh\"\n"; 361 | showEnvVarsInLog = 0; 362 | }; 363 | F92415B56C073015A92B2AA0 /* [CP] Embed Pods Frameworks */ = { 364 | isa = PBXShellScriptBuildPhase; 365 | buildActionMask = 2147483647; 366 | files = ( 367 | ); 368 | inputFileListPaths = ( 369 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 370 | ); 371 | name = "[CP] Embed Pods Frameworks"; 372 | outputFileListPaths = ( 373 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 374 | ); 375 | runOnlyForDeploymentPostprocessing = 0; 376 | shellPath = /bin/sh; 377 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; 378 | showEnvVarsInLog = 0; 379 | }; 380 | FD10A7F022414F080027D42C /* Start Packager */ = { 381 | isa = PBXShellScriptBuildPhase; 382 | buildActionMask = 2147483647; 383 | files = ( 384 | ); 385 | inputFileListPaths = ( 386 | ); 387 | inputPaths = ( 388 | ); 389 | name = "Start Packager"; 390 | outputFileListPaths = ( 391 | ); 392 | outputPaths = ( 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | shellPath = /bin/sh; 396 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 397 | showEnvVarsInLog = 0; 398 | }; 399 | /* End PBXShellScriptBuildPhase section */ 400 | 401 | /* Begin PBXSourcesBuildPhase section */ 402 | 00E356EA1AD99517003FC87E /* Sources */ = { 403 | isa = PBXSourcesBuildPhase; 404 | buildActionMask = 2147483647; 405 | files = ( 406 | 00E356F31AD99517003FC87E /* ExampleTests.m in Sources */, 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | }; 410 | 13B07F871A680F5B00A75B9A /* Sources */ = { 411 | isa = PBXSourcesBuildPhase; 412 | buildActionMask = 2147483647; 413 | files = ( 414 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 415 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 416 | ); 417 | runOnlyForDeploymentPostprocessing = 0; 418 | }; 419 | /* End PBXSourcesBuildPhase section */ 420 | 421 | /* Begin PBXTargetDependency section */ 422 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 423 | isa = PBXTargetDependency; 424 | target = 13B07F861A680F5B00A75B9A /* Example */; 425 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 426 | }; 427 | /* End PBXTargetDependency section */ 428 | 429 | /* Begin XCBuildConfiguration section */ 430 | 00E356F61AD99517003FC87E /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | baseConfigurationReference = B0107D1C097D10D527B5EC66 /* Pods-Example-ExampleTests.debug.xcconfig */; 433 | buildSettings = { 434 | BUNDLE_LOADER = "$(TEST_HOST)"; 435 | GCC_PREPROCESSOR_DEFINITIONS = ( 436 | "DEBUG=1", 437 | "$(inherited)", 438 | ); 439 | INFOPLIST_FILE = ExampleTests/Info.plist; 440 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 441 | LD_RUNPATH_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "@executable_path/Frameworks", 444 | "@loader_path/Frameworks", 445 | ); 446 | OTHER_LDFLAGS = ( 447 | "-ObjC", 448 | "-lc++", 449 | "$(inherited)", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 454 | }; 455 | name = Debug; 456 | }; 457 | 00E356F71AD99517003FC87E /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = C9273720021329D22AEB5B09 /* Pods-Example-ExampleTests.release.xcconfig */; 460 | buildSettings = { 461 | BUNDLE_LOADER = "$(TEST_HOST)"; 462 | COPY_PHASE_STRIP = NO; 463 | INFOPLIST_FILE = ExampleTests/Info.plist; 464 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 465 | LD_RUNPATH_SEARCH_PATHS = ( 466 | "$(inherited)", 467 | "@executable_path/Frameworks", 468 | "@loader_path/Frameworks", 469 | ); 470 | OTHER_LDFLAGS = ( 471 | "-ObjC", 472 | "-lc++", 473 | "$(inherited)", 474 | ); 475 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; 478 | }; 479 | name = Release; 480 | }; 481 | 13B07F941A680F5B00A75B9A /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | baseConfigurationReference = 285A55555794D9F79494EDAA /* Pods-Example.debug.xcconfig */; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CLANG_ENABLE_MODULES = YES; 487 | CURRENT_PROJECT_VERSION = 1; 488 | ENABLE_BITCODE = NO; 489 | INFOPLIST_FILE = Example/Info.plist; 490 | LD_RUNPATH_SEARCH_PATHS = ( 491 | "$(inherited)", 492 | "@executable_path/Frameworks", 493 | ); 494 | OTHER_LDFLAGS = ( 495 | "$(inherited)", 496 | "-ObjC", 497 | "-lc++", 498 | ); 499 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 500 | PRODUCT_NAME = Example; 501 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 502 | SWIFT_VERSION = 5.0; 503 | VERSIONING_SYSTEM = "apple-generic"; 504 | }; 505 | name = Debug; 506 | }; 507 | 13B07F951A680F5B00A75B9A /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | baseConfigurationReference = 49B47AE0E62B61C1A4BC0A3F /* Pods-Example.release.xcconfig */; 510 | buildSettings = { 511 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 512 | CLANG_ENABLE_MODULES = YES; 513 | CURRENT_PROJECT_VERSION = 1; 514 | INFOPLIST_FILE = Example/Info.plist; 515 | LD_RUNPATH_SEARCH_PATHS = ( 516 | "$(inherited)", 517 | "@executable_path/Frameworks", 518 | ); 519 | OTHER_LDFLAGS = ( 520 | "$(inherited)", 521 | "-ObjC", 522 | "-lc++", 523 | ); 524 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 525 | PRODUCT_NAME = Example; 526 | SWIFT_VERSION = 5.0; 527 | VERSIONING_SYSTEM = "apple-generic"; 528 | }; 529 | name = Release; 530 | }; 531 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | ALWAYS_SEARCH_USER_PATHS = NO; 535 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 536 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 537 | CLANG_CXX_LIBRARY = "libc++"; 538 | CLANG_ENABLE_MODULES = YES; 539 | CLANG_ENABLE_OBJC_ARC = YES; 540 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 541 | CLANG_WARN_BOOL_CONVERSION = YES; 542 | CLANG_WARN_COMMA = YES; 543 | CLANG_WARN_CONSTANT_CONVERSION = YES; 544 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 545 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 546 | CLANG_WARN_EMPTY_BODY = YES; 547 | CLANG_WARN_ENUM_CONVERSION = YES; 548 | CLANG_WARN_INFINITE_RECURSION = YES; 549 | CLANG_WARN_INT_CONVERSION = YES; 550 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 551 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 552 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 553 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 554 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 555 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 556 | CLANG_WARN_STRICT_PROTOTYPES = YES; 557 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 558 | CLANG_WARN_UNREACHABLE_CODE = YES; 559 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 560 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 561 | COPY_PHASE_STRIP = NO; 562 | ENABLE_STRICT_OBJC_MSGSEND = YES; 563 | ENABLE_TESTABILITY = YES; 564 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 565 | GCC_C_LANGUAGE_STANDARD = gnu99; 566 | GCC_DYNAMIC_NO_PIC = NO; 567 | GCC_NO_COMMON_BLOCKS = YES; 568 | GCC_OPTIMIZATION_LEVEL = 0; 569 | GCC_PREPROCESSOR_DEFINITIONS = ( 570 | "DEBUG=1", 571 | "$(inherited)", 572 | ); 573 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 574 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 575 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 576 | GCC_WARN_UNDECLARED_SELECTOR = YES; 577 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 578 | GCC_WARN_UNUSED_FUNCTION = YES; 579 | GCC_WARN_UNUSED_VARIABLE = YES; 580 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 581 | LD_RUNPATH_SEARCH_PATHS = ( 582 | /usr/lib/swift, 583 | "$(inherited)", 584 | ); 585 | LIBRARY_SEARCH_PATHS = ( 586 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 587 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 588 | "\"$(inherited)\"", 589 | ); 590 | MTL_ENABLE_DEBUG_INFO = YES; 591 | ONLY_ACTIVE_ARCH = YES; 592 | SDKROOT = iphoneos; 593 | }; 594 | name = Debug; 595 | }; 596 | 83CBBA211A601CBA00E9B192 /* Release */ = { 597 | isa = XCBuildConfiguration; 598 | buildSettings = { 599 | ALWAYS_SEARCH_USER_PATHS = NO; 600 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 601 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 602 | CLANG_CXX_LIBRARY = "libc++"; 603 | CLANG_ENABLE_MODULES = YES; 604 | CLANG_ENABLE_OBJC_ARC = YES; 605 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 606 | CLANG_WARN_BOOL_CONVERSION = YES; 607 | CLANG_WARN_COMMA = YES; 608 | CLANG_WARN_CONSTANT_CONVERSION = YES; 609 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 610 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 611 | CLANG_WARN_EMPTY_BODY = YES; 612 | CLANG_WARN_ENUM_CONVERSION = YES; 613 | CLANG_WARN_INFINITE_RECURSION = YES; 614 | CLANG_WARN_INT_CONVERSION = YES; 615 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 616 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 617 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 618 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 619 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 620 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 621 | CLANG_WARN_STRICT_PROTOTYPES = YES; 622 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 623 | CLANG_WARN_UNREACHABLE_CODE = YES; 624 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 625 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 626 | COPY_PHASE_STRIP = YES; 627 | ENABLE_NS_ASSERTIONS = NO; 628 | ENABLE_STRICT_OBJC_MSGSEND = YES; 629 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 "; 630 | GCC_C_LANGUAGE_STANDARD = gnu99; 631 | GCC_NO_COMMON_BLOCKS = YES; 632 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 633 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 634 | GCC_WARN_UNDECLARED_SELECTOR = YES; 635 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 636 | GCC_WARN_UNUSED_FUNCTION = YES; 637 | GCC_WARN_UNUSED_VARIABLE = YES; 638 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 639 | LD_RUNPATH_SEARCH_PATHS = ( 640 | /usr/lib/swift, 641 | "$(inherited)", 642 | ); 643 | LIBRARY_SEARCH_PATHS = ( 644 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 645 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 646 | "\"$(inherited)\"", 647 | ); 648 | MTL_ENABLE_DEBUG_INFO = NO; 649 | SDKROOT = iphoneos; 650 | VALIDATE_PRODUCT = YES; 651 | }; 652 | name = Release; 653 | }; 654 | /* End XCBuildConfiguration section */ 655 | 656 | /* Begin XCConfigurationList section */ 657 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */ = { 658 | isa = XCConfigurationList; 659 | buildConfigurations = ( 660 | 00E356F61AD99517003FC87E /* Debug */, 661 | 00E356F71AD99517003FC87E /* Release */, 662 | ); 663 | defaultConfigurationIsVisible = 0; 664 | defaultConfigurationName = Release; 665 | }; 666 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */ = { 667 | isa = XCConfigurationList; 668 | buildConfigurations = ( 669 | 13B07F941A680F5B00A75B9A /* Debug */, 670 | 13B07F951A680F5B00A75B9A /* Release */, 671 | ); 672 | defaultConfigurationIsVisible = 0; 673 | defaultConfigurationName = Release; 674 | }; 675 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */ = { 676 | isa = XCConfigurationList; 677 | buildConfigurations = ( 678 | 83CBBA201A601CBA00E9B192 /* Debug */, 679 | 83CBBA211A601CBA00E9B192 /* Release */, 680 | ); 681 | defaultConfigurationIsVisible = 0; 682 | defaultConfigurationName = Release; 683 | }; 684 | /* End XCConfigurationList section */ 685 | }; 686 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 687 | } 688 | -------------------------------------------------------------------------------- /Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /Example/ios/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Example/ios/Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"Example" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/ios/Example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/ios/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/ios/Example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/ios/Example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Example/ios/ExampleTests/ExampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface ExampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation ExampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/ios/ExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'Example' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | target 'ExampleTests' do 16 | inherit! :complete 17 | # Pods for testing 18 | end 19 | 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | use_flipper!() 25 | 26 | post_install do |installer| 27 | react_native_post_install(installer) 28 | end 29 | end -------------------------------------------------------------------------------- /Example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.64.2) 6 | - FBReactNativeSpec (0.64.2): 7 | - RCT-Folly (= 2020.01.13.00) 8 | - RCTRequired (= 0.64.2) 9 | - RCTTypeSafety (= 0.64.2) 10 | - React-Core (= 0.64.2) 11 | - React-jsi (= 0.64.2) 12 | - ReactCommon/turbomodule/core (= 0.64.2) 13 | - Flipper (0.75.1): 14 | - Flipper-Folly (~> 2.5) 15 | - Flipper-RSocket (~> 1.3) 16 | - Flipper-DoubleConversion (1.1.7) 17 | - Flipper-Folly (2.5.3): 18 | - boost-for-react-native 19 | - Flipper-DoubleConversion 20 | - Flipper-Glog 21 | - libevent (~> 2.1.12) 22 | - OpenSSL-Universal (= 1.1.180) 23 | - Flipper-Glog (0.3.6) 24 | - Flipper-PeerTalk (0.0.4) 25 | - Flipper-RSocket (1.3.1): 26 | - Flipper-Folly (~> 2.5) 27 | - FlipperKit (0.75.1): 28 | - FlipperKit/Core (= 0.75.1) 29 | - FlipperKit/Core (0.75.1): 30 | - Flipper (~> 0.75.1) 31 | - FlipperKit/CppBridge 32 | - FlipperKit/FBCxxFollyDynamicConvert 33 | - FlipperKit/FBDefines 34 | - FlipperKit/FKPortForwarding 35 | - FlipperKit/CppBridge (0.75.1): 36 | - Flipper (~> 0.75.1) 37 | - FlipperKit/FBCxxFollyDynamicConvert (0.75.1): 38 | - Flipper-Folly (~> 2.5) 39 | - FlipperKit/FBDefines (0.75.1) 40 | - FlipperKit/FKPortForwarding (0.75.1): 41 | - CocoaAsyncSocket (~> 7.6) 42 | - Flipper-PeerTalk (~> 0.0.4) 43 | - FlipperKit/FlipperKitHighlightOverlay (0.75.1) 44 | - FlipperKit/FlipperKitLayoutPlugin (0.75.1): 45 | - FlipperKit/Core 46 | - FlipperKit/FlipperKitHighlightOverlay 47 | - FlipperKit/FlipperKitLayoutTextSearchable 48 | - YogaKit (~> 1.18) 49 | - FlipperKit/FlipperKitLayoutTextSearchable (0.75.1) 50 | - FlipperKit/FlipperKitNetworkPlugin (0.75.1): 51 | - FlipperKit/Core 52 | - FlipperKit/FlipperKitReactPlugin (0.75.1): 53 | - FlipperKit/Core 54 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.75.1): 55 | - FlipperKit/Core 56 | - FlipperKit/SKIOSNetworkPlugin (0.75.1): 57 | - FlipperKit/Core 58 | - FlipperKit/FlipperKitNetworkPlugin 59 | - glog (0.3.5) 60 | - libevent (2.1.12) 61 | - OpenSSL-Universal (1.1.180) 62 | - RCT-Folly (2020.01.13.00): 63 | - boost-for-react-native 64 | - DoubleConversion 65 | - glog 66 | - RCT-Folly/Default (= 2020.01.13.00) 67 | - RCT-Folly/Default (2020.01.13.00): 68 | - boost-for-react-native 69 | - DoubleConversion 70 | - glog 71 | - RCTRequired (0.64.2) 72 | - RCTTypeSafety (0.64.2): 73 | - FBLazyVector (= 0.64.2) 74 | - RCT-Folly (= 2020.01.13.00) 75 | - RCTRequired (= 0.64.2) 76 | - React-Core (= 0.64.2) 77 | - React (0.64.2): 78 | - React-Core (= 0.64.2) 79 | - React-Core/DevSupport (= 0.64.2) 80 | - React-Core/RCTWebSocket (= 0.64.2) 81 | - React-RCTActionSheet (= 0.64.2) 82 | - React-RCTAnimation (= 0.64.2) 83 | - React-RCTBlob (= 0.64.2) 84 | - React-RCTImage (= 0.64.2) 85 | - React-RCTLinking (= 0.64.2) 86 | - React-RCTNetwork (= 0.64.2) 87 | - React-RCTSettings (= 0.64.2) 88 | - React-RCTText (= 0.64.2) 89 | - React-RCTVibration (= 0.64.2) 90 | - React-callinvoker (0.64.2) 91 | - React-Core (0.64.2): 92 | - glog 93 | - RCT-Folly (= 2020.01.13.00) 94 | - React-Core/Default (= 0.64.2) 95 | - React-cxxreact (= 0.64.2) 96 | - React-jsi (= 0.64.2) 97 | - React-jsiexecutor (= 0.64.2) 98 | - React-perflogger (= 0.64.2) 99 | - Yoga 100 | - React-Core/CoreModulesHeaders (0.64.2): 101 | - glog 102 | - RCT-Folly (= 2020.01.13.00) 103 | - React-Core/Default 104 | - React-cxxreact (= 0.64.2) 105 | - React-jsi (= 0.64.2) 106 | - React-jsiexecutor (= 0.64.2) 107 | - React-perflogger (= 0.64.2) 108 | - Yoga 109 | - React-Core/Default (0.64.2): 110 | - glog 111 | - RCT-Folly (= 2020.01.13.00) 112 | - React-cxxreact (= 0.64.2) 113 | - React-jsi (= 0.64.2) 114 | - React-jsiexecutor (= 0.64.2) 115 | - React-perflogger (= 0.64.2) 116 | - Yoga 117 | - React-Core/DevSupport (0.64.2): 118 | - glog 119 | - RCT-Folly (= 2020.01.13.00) 120 | - React-Core/Default (= 0.64.2) 121 | - React-Core/RCTWebSocket (= 0.64.2) 122 | - React-cxxreact (= 0.64.2) 123 | - React-jsi (= 0.64.2) 124 | - React-jsiexecutor (= 0.64.2) 125 | - React-jsinspector (= 0.64.2) 126 | - React-perflogger (= 0.64.2) 127 | - Yoga 128 | - React-Core/RCTActionSheetHeaders (0.64.2): 129 | - glog 130 | - RCT-Folly (= 2020.01.13.00) 131 | - React-Core/Default 132 | - React-cxxreact (= 0.64.2) 133 | - React-jsi (= 0.64.2) 134 | - React-jsiexecutor (= 0.64.2) 135 | - React-perflogger (= 0.64.2) 136 | - Yoga 137 | - React-Core/RCTAnimationHeaders (0.64.2): 138 | - glog 139 | - RCT-Folly (= 2020.01.13.00) 140 | - React-Core/Default 141 | - React-cxxreact (= 0.64.2) 142 | - React-jsi (= 0.64.2) 143 | - React-jsiexecutor (= 0.64.2) 144 | - React-perflogger (= 0.64.2) 145 | - Yoga 146 | - React-Core/RCTBlobHeaders (0.64.2): 147 | - glog 148 | - RCT-Folly (= 2020.01.13.00) 149 | - React-Core/Default 150 | - React-cxxreact (= 0.64.2) 151 | - React-jsi (= 0.64.2) 152 | - React-jsiexecutor (= 0.64.2) 153 | - React-perflogger (= 0.64.2) 154 | - Yoga 155 | - React-Core/RCTImageHeaders (0.64.2): 156 | - glog 157 | - RCT-Folly (= 2020.01.13.00) 158 | - React-Core/Default 159 | - React-cxxreact (= 0.64.2) 160 | - React-jsi (= 0.64.2) 161 | - React-jsiexecutor (= 0.64.2) 162 | - React-perflogger (= 0.64.2) 163 | - Yoga 164 | - React-Core/RCTLinkingHeaders (0.64.2): 165 | - glog 166 | - RCT-Folly (= 2020.01.13.00) 167 | - React-Core/Default 168 | - React-cxxreact (= 0.64.2) 169 | - React-jsi (= 0.64.2) 170 | - React-jsiexecutor (= 0.64.2) 171 | - React-perflogger (= 0.64.2) 172 | - Yoga 173 | - React-Core/RCTNetworkHeaders (0.64.2): 174 | - glog 175 | - RCT-Folly (= 2020.01.13.00) 176 | - React-Core/Default 177 | - React-cxxreact (= 0.64.2) 178 | - React-jsi (= 0.64.2) 179 | - React-jsiexecutor (= 0.64.2) 180 | - React-perflogger (= 0.64.2) 181 | - Yoga 182 | - React-Core/RCTSettingsHeaders (0.64.2): 183 | - glog 184 | - RCT-Folly (= 2020.01.13.00) 185 | - React-Core/Default 186 | - React-cxxreact (= 0.64.2) 187 | - React-jsi (= 0.64.2) 188 | - React-jsiexecutor (= 0.64.2) 189 | - React-perflogger (= 0.64.2) 190 | - Yoga 191 | - React-Core/RCTTextHeaders (0.64.2): 192 | - glog 193 | - RCT-Folly (= 2020.01.13.00) 194 | - React-Core/Default 195 | - React-cxxreact (= 0.64.2) 196 | - React-jsi (= 0.64.2) 197 | - React-jsiexecutor (= 0.64.2) 198 | - React-perflogger (= 0.64.2) 199 | - Yoga 200 | - React-Core/RCTVibrationHeaders (0.64.2): 201 | - glog 202 | - RCT-Folly (= 2020.01.13.00) 203 | - React-Core/Default 204 | - React-cxxreact (= 0.64.2) 205 | - React-jsi (= 0.64.2) 206 | - React-jsiexecutor (= 0.64.2) 207 | - React-perflogger (= 0.64.2) 208 | - Yoga 209 | - React-Core/RCTWebSocket (0.64.2): 210 | - glog 211 | - RCT-Folly (= 2020.01.13.00) 212 | - React-Core/Default (= 0.64.2) 213 | - React-cxxreact (= 0.64.2) 214 | - React-jsi (= 0.64.2) 215 | - React-jsiexecutor (= 0.64.2) 216 | - React-perflogger (= 0.64.2) 217 | - Yoga 218 | - React-CoreModules (0.64.2): 219 | - FBReactNativeSpec (= 0.64.2) 220 | - RCT-Folly (= 2020.01.13.00) 221 | - RCTTypeSafety (= 0.64.2) 222 | - React-Core/CoreModulesHeaders (= 0.64.2) 223 | - React-jsi (= 0.64.2) 224 | - React-RCTImage (= 0.64.2) 225 | - ReactCommon/turbomodule/core (= 0.64.2) 226 | - React-cxxreact (0.64.2): 227 | - boost-for-react-native (= 1.63.0) 228 | - DoubleConversion 229 | - glog 230 | - RCT-Folly (= 2020.01.13.00) 231 | - React-callinvoker (= 0.64.2) 232 | - React-jsi (= 0.64.2) 233 | - React-jsinspector (= 0.64.2) 234 | - React-perflogger (= 0.64.2) 235 | - React-runtimeexecutor (= 0.64.2) 236 | - React-jsi (0.64.2): 237 | - boost-for-react-native (= 1.63.0) 238 | - DoubleConversion 239 | - glog 240 | - RCT-Folly (= 2020.01.13.00) 241 | - React-jsi/Default (= 0.64.2) 242 | - React-jsi/Default (0.64.2): 243 | - boost-for-react-native (= 1.63.0) 244 | - DoubleConversion 245 | - glog 246 | - RCT-Folly (= 2020.01.13.00) 247 | - React-jsiexecutor (0.64.2): 248 | - DoubleConversion 249 | - glog 250 | - RCT-Folly (= 2020.01.13.00) 251 | - React-cxxreact (= 0.64.2) 252 | - React-jsi (= 0.64.2) 253 | - React-perflogger (= 0.64.2) 254 | - React-jsinspector (0.64.2) 255 | - React-perflogger (0.64.2) 256 | - React-RCTActionSheet (0.64.2): 257 | - React-Core/RCTActionSheetHeaders (= 0.64.2) 258 | - React-RCTAnimation (0.64.2): 259 | - FBReactNativeSpec (= 0.64.2) 260 | - RCT-Folly (= 2020.01.13.00) 261 | - RCTTypeSafety (= 0.64.2) 262 | - React-Core/RCTAnimationHeaders (= 0.64.2) 263 | - React-jsi (= 0.64.2) 264 | - ReactCommon/turbomodule/core (= 0.64.2) 265 | - React-RCTBlob (0.64.2): 266 | - FBReactNativeSpec (= 0.64.2) 267 | - RCT-Folly (= 2020.01.13.00) 268 | - React-Core/RCTBlobHeaders (= 0.64.2) 269 | - React-Core/RCTWebSocket (= 0.64.2) 270 | - React-jsi (= 0.64.2) 271 | - React-RCTNetwork (= 0.64.2) 272 | - ReactCommon/turbomodule/core (= 0.64.2) 273 | - React-RCTImage (0.64.2): 274 | - FBReactNativeSpec (= 0.64.2) 275 | - RCT-Folly (= 2020.01.13.00) 276 | - RCTTypeSafety (= 0.64.2) 277 | - React-Core/RCTImageHeaders (= 0.64.2) 278 | - React-jsi (= 0.64.2) 279 | - React-RCTNetwork (= 0.64.2) 280 | - ReactCommon/turbomodule/core (= 0.64.2) 281 | - React-RCTLinking (0.64.2): 282 | - FBReactNativeSpec (= 0.64.2) 283 | - React-Core/RCTLinkingHeaders (= 0.64.2) 284 | - React-jsi (= 0.64.2) 285 | - ReactCommon/turbomodule/core (= 0.64.2) 286 | - React-RCTNetwork (0.64.2): 287 | - FBReactNativeSpec (= 0.64.2) 288 | - RCT-Folly (= 2020.01.13.00) 289 | - RCTTypeSafety (= 0.64.2) 290 | - React-Core/RCTNetworkHeaders (= 0.64.2) 291 | - React-jsi (= 0.64.2) 292 | - ReactCommon/turbomodule/core (= 0.64.2) 293 | - React-RCTSettings (0.64.2): 294 | - FBReactNativeSpec (= 0.64.2) 295 | - RCT-Folly (= 2020.01.13.00) 296 | - RCTTypeSafety (= 0.64.2) 297 | - React-Core/RCTSettingsHeaders (= 0.64.2) 298 | - React-jsi (= 0.64.2) 299 | - ReactCommon/turbomodule/core (= 0.64.2) 300 | - React-RCTText (0.64.2): 301 | - React-Core/RCTTextHeaders (= 0.64.2) 302 | - React-RCTVibration (0.64.2): 303 | - FBReactNativeSpec (= 0.64.2) 304 | - RCT-Folly (= 2020.01.13.00) 305 | - React-Core/RCTVibrationHeaders (= 0.64.2) 306 | - React-jsi (= 0.64.2) 307 | - ReactCommon/turbomodule/core (= 0.64.2) 308 | - React-runtimeexecutor (0.64.2): 309 | - React-jsi (= 0.64.2) 310 | - ReactCommon/turbomodule/core (0.64.2): 311 | - DoubleConversion 312 | - glog 313 | - RCT-Folly (= 2020.01.13.00) 314 | - React-callinvoker (= 0.64.2) 315 | - React-Core (= 0.64.2) 316 | - React-cxxreact (= 0.64.2) 317 | - React-jsi (= 0.64.2) 318 | - React-perflogger (= 0.64.2) 319 | - RNSVG (12.1.1): 320 | - React 321 | - Yoga (1.14.0) 322 | - YogaKit (1.18.1): 323 | - Yoga (~> 1.14) 324 | 325 | DEPENDENCIES: 326 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 327 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 328 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 329 | - Flipper (~> 0.75.1) 330 | - Flipper-DoubleConversion (= 1.1.7) 331 | - Flipper-Folly (~> 2.5.3) 332 | - Flipper-Glog (= 0.3.6) 333 | - Flipper-PeerTalk (~> 0.0.4) 334 | - Flipper-RSocket (~> 1.3) 335 | - FlipperKit (~> 0.75.1) 336 | - FlipperKit/Core (~> 0.75.1) 337 | - FlipperKit/CppBridge (~> 0.75.1) 338 | - FlipperKit/FBCxxFollyDynamicConvert (~> 0.75.1) 339 | - FlipperKit/FBDefines (~> 0.75.1) 340 | - FlipperKit/FKPortForwarding (~> 0.75.1) 341 | - FlipperKit/FlipperKitHighlightOverlay (~> 0.75.1) 342 | - FlipperKit/FlipperKitLayoutPlugin (~> 0.75.1) 343 | - FlipperKit/FlipperKitLayoutTextSearchable (~> 0.75.1) 344 | - FlipperKit/FlipperKitNetworkPlugin (~> 0.75.1) 345 | - FlipperKit/FlipperKitReactPlugin (~> 0.75.1) 346 | - FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.75.1) 347 | - FlipperKit/SKIOSNetworkPlugin (~> 0.75.1) 348 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 349 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 350 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 351 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 352 | - React (from `../node_modules/react-native/`) 353 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 354 | - React-Core (from `../node_modules/react-native/`) 355 | - React-Core/DevSupport (from `../node_modules/react-native/`) 356 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 357 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 358 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 359 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 360 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 361 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 362 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 363 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 364 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 365 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 366 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 367 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 368 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 369 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 370 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 371 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 372 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 373 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 374 | - RNSVG (from `../node_modules/react-native-svg`) 375 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 376 | 377 | SPEC REPOS: 378 | trunk: 379 | - boost-for-react-native 380 | - CocoaAsyncSocket 381 | - Flipper 382 | - Flipper-DoubleConversion 383 | - Flipper-Folly 384 | - Flipper-Glog 385 | - Flipper-PeerTalk 386 | - Flipper-RSocket 387 | - FlipperKit 388 | - libevent 389 | - OpenSSL-Universal 390 | - YogaKit 391 | 392 | EXTERNAL SOURCES: 393 | DoubleConversion: 394 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 395 | FBLazyVector: 396 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 397 | FBReactNativeSpec: 398 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 399 | glog: 400 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 401 | RCT-Folly: 402 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 403 | RCTRequired: 404 | :path: "../node_modules/react-native/Libraries/RCTRequired" 405 | RCTTypeSafety: 406 | :path: "../node_modules/react-native/Libraries/TypeSafety" 407 | React: 408 | :path: "../node_modules/react-native/" 409 | React-callinvoker: 410 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 411 | React-Core: 412 | :path: "../node_modules/react-native/" 413 | React-CoreModules: 414 | :path: "../node_modules/react-native/React/CoreModules" 415 | React-cxxreact: 416 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 417 | React-jsi: 418 | :path: "../node_modules/react-native/ReactCommon/jsi" 419 | React-jsiexecutor: 420 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 421 | React-jsinspector: 422 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 423 | React-perflogger: 424 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 425 | React-RCTActionSheet: 426 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 427 | React-RCTAnimation: 428 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 429 | React-RCTBlob: 430 | :path: "../node_modules/react-native/Libraries/Blob" 431 | React-RCTImage: 432 | :path: "../node_modules/react-native/Libraries/Image" 433 | React-RCTLinking: 434 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 435 | React-RCTNetwork: 436 | :path: "../node_modules/react-native/Libraries/Network" 437 | React-RCTSettings: 438 | :path: "../node_modules/react-native/Libraries/Settings" 439 | React-RCTText: 440 | :path: "../node_modules/react-native/Libraries/Text" 441 | React-RCTVibration: 442 | :path: "../node_modules/react-native/Libraries/Vibration" 443 | React-runtimeexecutor: 444 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 445 | ReactCommon: 446 | :path: "../node_modules/react-native/ReactCommon" 447 | RNSVG: 448 | :path: "../node_modules/react-native-svg" 449 | Yoga: 450 | :path: "../node_modules/react-native/ReactCommon/yoga" 451 | 452 | SPEC CHECKSUMS: 453 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 454 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 455 | DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de 456 | FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b 457 | FBReactNativeSpec: c18c7a4cd6bdd46880478a20bdb39a108b4b922c 458 | Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021 459 | Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41 460 | Flipper-Folly: 755929a4f851b2fb2c347d533a23f191b008554c 461 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 462 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 463 | Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154 464 | FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00 465 | glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 466 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 467 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b 468 | RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c 469 | RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728 470 | RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa 471 | React: bda6b6d7ae912de97d7a61aa5c160db24aa2ad69 472 | React-callinvoker: 9840ea7e8e88ed73d438edb725574820b29b5baa 473 | React-Core: b5e385da7ce5f16a220fc60fd0749eae2c6120f0 474 | React-CoreModules: 17071a4e2c5239b01585f4aa8070141168ab298f 475 | React-cxxreact: 9be7b6340ed9f7c53e53deca7779f07cd66525ba 476 | React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427 477 | React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3 478 | React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae 479 | React-perflogger: 25373e382fed75ce768a443822f07098a15ab737 480 | React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5 481 | React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa 482 | React-RCTBlob: 02a2887023e0eed99391b6445b2e23a2a6f9226d 483 | React-RCTImage: ce5bf8e7438f2286d9b646a05d6ab11f38b0323d 484 | React-RCTLinking: ccd20742de14e020cb5f99d5c7e0bf0383aefbd9 485 | React-RCTNetwork: dfb9d089ab0753e5e5f55fc4b1210858f7245647 486 | React-RCTSettings: b14aef2d83699e48b410fb7c3ba5b66cd3291ae2 487 | React-RCTText: 41a2e952dd9adc5caf6fb68ed46b275194d5da5f 488 | React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3 489 | React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9 490 | ReactCommon: 149906e01aa51142707a10665185db879898e966 491 | RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f 492 | Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac 493 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 494 | 495 | PODFILE CHECKSUM: d24bf39ea41186607a7a2d6f21b4ffb7c434338e 496 | 497 | COCOAPODS: 1.10.1 498 | -------------------------------------------------------------------------------- /Example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /Example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "postinstall": "DESTINATION='node_modules/react-native-progress' LIB_FILE=`cd .. && echo \\`pwd\\`/\\`npm pack\\`` && (rm -rf $DESTINATION || true) && mkdir $DESTINATION && tar -xvzf $LIB_FILE -C $DESTINATION --strip-components 1 && rm $LIB_FILE", 9 | "start": "react-native start", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "react": "17.0.1", 14 | "react-native": "0.64.2", 15 | "react-native-progress": "*", 16 | "react-native-svg": "^12.1.1" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.14.6", 20 | "@babel/runtime": "^7.14.6", 21 | "babel-jest": "^27.0.6", 22 | "jest": "^27.0.6", 23 | "metro-react-native-babel-preset": "^0.66.0", 24 | "react-test-renderer": "17.0.1" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Joel Arvidsson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pie.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Animated, StyleSheet, View } from 'react-native'; 4 | import { Svg } from 'react-native-svg'; 5 | 6 | import Circle from './Shapes/Circle'; 7 | import Sector from './Shapes/Sector'; 8 | import withAnimation from './withAnimation'; 9 | 10 | const CIRCLE = Math.PI * 2; 11 | 12 | const AnimatedSvg = Animated.createAnimatedComponent(Svg); 13 | const AnimatedSector = Animated.createAnimatedComponent(Sector); 14 | 15 | const styles = StyleSheet.create({ 16 | container: { 17 | backgroundColor: 'transparent', 18 | overflow: 'hidden', 19 | }, 20 | }); 21 | 22 | export class ProgressPie extends Component { 23 | static propTypes = { 24 | animated: PropTypes.bool, 25 | borderColor: PropTypes.string, 26 | borderWidth: PropTypes.number, 27 | color: PropTypes.string, 28 | children: PropTypes.node, 29 | progress: PropTypes.oneOfType([ 30 | PropTypes.number, 31 | PropTypes.instanceOf(Animated.Value), 32 | ]), 33 | rotation: PropTypes.instanceOf(Animated.Value), 34 | size: PropTypes.number, 35 | style: PropTypes.any, 36 | unfilledColor: PropTypes.string, 37 | }; 38 | 39 | static defaultProps = { 40 | borderWidth: 1, 41 | color: 'rgba(0, 122, 255, 1)', 42 | progress: 0, 43 | size: 40, 44 | }; 45 | 46 | render() { 47 | const { 48 | animated, 49 | borderColor, 50 | borderWidth, 51 | children, 52 | color, 53 | progress, 54 | rotation, 55 | size, 56 | style, 57 | unfilledColor, 58 | ...restProps 59 | } = this.props; 60 | 61 | const Surface = rotation ? AnimatedSvg : Svg; 62 | const Shape = animated ? AnimatedSector : Sector; 63 | 64 | const angle = animated 65 | ? Animated.multiply(progress, CIRCLE) 66 | : progress * CIRCLE; 67 | const radius = size / 2 - borderWidth; 68 | const offset = { 69 | top: borderWidth, 70 | left: borderWidth, 71 | }; 72 | 73 | return ( 74 | 75 | 94 | {unfilledColor ? ( 95 | 96 | ) : ( 97 | false 98 | )} 99 | 100 | {borderWidth ? ( 101 | 106 | ) : ( 107 | false 108 | )} 109 | 110 | {children} 111 | 112 | ); 113 | } 114 | } 115 | 116 | export default withAnimation(ProgressPie, 0.2); 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-progress 2 | 3 | Progress indicators and spinners for React Native using React Native SVG. 4 | 5 | ![progress-demo](https://cloud.githubusercontent.com/assets/378279/11212043/64fb1420-8d01-11e5-9ec0-5e175a837c62.gif) 6 | 7 | ## Installation 8 | 9 | `$ npm install react-native-progress --save` 10 | 11 | ### React Native SVG based components 12 | 13 | To use the `Pie` or `Circle` components, you need to install [React Native SVG](https://github.com/react-native-svg/react-native-svg) in your project. 14 | 15 | ## Usage 16 | 17 | _Note: If you don't want the React Native SVG based components and it's dependencies, do a deep require instead: `import ProgressBar from 'react-native-progress/Bar';`._ 18 | 19 | ```js 20 | import * as Progress from 'react-native-progress'; 21 | 22 | 23 | 24 | 25 | 26 | ``` 27 | 28 | ### Properties for all progress components 29 | 30 | | Prop | Description | Default | 31 | | ------------------------------------ | ---------------------------------------------------------------------------- | ---------------------- | 32 | | **`animated`** | Whether or not to animate changes to `progress`. | `true` | 33 | | **`indeterminate`** | If set to true, the indicator will spin and `progress` prop will be ignored. | `false` | 34 | | **`indeterminateAnimationDuration`** | Sets animation duration in milliseconds when indeterminate is set. | `1000` | 35 | | **`progress`** | Progress of whatever the indicator is indicating. A number between 0 and 1. | `0` | 36 | | **`color`** | Fill color of the indicator. | `rgba(0, 122, 255, 1)` | 37 | | **`unfilledColor`** | Color of the remaining progress. | _None_ | 38 | | **`borderWidth`** | Width of outer border, set to `0` to remove. | `1` | 39 | | **`borderColor`** | Color of outer border. | `color` | 40 | 41 | ### `Progress.Bar` 42 | 43 | All of the props under _Properties_ in addition to the following: 44 | 45 | | Prop | Description | Default | 46 | | --------------------- | ------------------------------------------------------------------------------ | ------------------- | 47 | | **`width`** | Full width of the progress bar, set to `null` to use automatic flexbox sizing. | `150` | 48 | | **`height`** | Height of the progress bar. | `6` | 49 | | **`borderRadius`** | Rounding of corners, set to `0` to disable. | `4` | 50 | | **`useNativeDriver`** | Use native driver for the animations. | `false` | 51 | | **`animationConfig`** | Config that is passed into the `Animated` function. | `{ bounciness: 0 }` | 52 | | **`animationType`** | Animation type to animate the progress, one of: `decay`, `timing`, `spring`. | `spring` | 53 | 54 | ### `Progress.Circle` 55 | 56 | All of the props under _Properties_ in addition to the following: 57 | 58 | | Prop | Description | Default | 59 | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------ | 60 | | **`size`** | Diameter of the circle. | `40` | 61 | | **`endAngle`** | Determines the endAngle of the circle. A number between `0` and `1`. The final endAngle would be the number multiplied by 2π | `0.9` | 62 | | **`thickness`** | Thickness of the inner circle. | `3` | 63 | | **`showsText`** | Whether or not to show a text representation of current progress. | `false` | 64 | | **`formatText(progress)`** | A function returning a string to be displayed for the textual representation. | _See source_ | 65 | | **`textStyle`** | Styles for progress text, defaults to a same `color` as circle and `fontSize` proportional to `size` prop. | _None_ | 66 | | **`allowFontScaling`** | Whether or not to respect device font scale setting. | _true_ | 67 | | **`direction`** | Direction of the circle `clockwise` or `counter-clockwise`. | `clockwise` | 68 | | **`strokeCap`** | Stroke Cap style for the circle `butt`, `square` or `round`. | `butt` | 69 | | **`fill`** | Fill color of the inner circle. | None (transparent) | 70 | 71 | ### `Progress.Pie` 72 | 73 | All of the props under _Properties_ in addition to the following: 74 | 75 | | Prop | Description | Default | 76 | | ---------- | -------------------- | ------- | 77 | | **`size`** | Diameter of the pie. | `40` | 78 | 79 | ### `Progress.CircleSnail` 80 | 81 | | Prop | Description | Default | 82 | | ---------------------- | --------------------------------------------------------------- | ---------------------- | 83 | | **`animating`** | If the circle should animate. | `true` | 84 | | **`hidesWhenStopped`** | If the circle should be removed when not animating. | `false` | 85 | | **`size`** | Diameter of the circle. | `40` | 86 | | **`color`** | Color of the circle, use an array of colors for rainbow effect. | `rgba(0, 122, 255, 1)` | 87 | | **`thickness`** | Thickness of the circle. | `3` | 88 | | **`duration`** | Duration of animation. | `1000` | 89 | | **`spinDuration`** | Duration of spin (orbit) animation. | `5000` | 90 | | **`strokeCap`** | Stroke Cap style for the circle `butt`, `square` or `round`. | `round` | 91 | 92 | ## Examples 93 | 94 | - [`Example` project bundled with this module](https://github.com/oblador/react-native-progress/tree/master/Example) 95 | - [react-native-image-progress](https://github.com/oblador/react-native-image-progress) 96 | 97 | ## [Changelog](https://github.com/oblador/react-native-progress/releases) 98 | 99 | ## Thanks 100 | 101 | To [Mandarin Drummond](https://github.com/MandarinConLaBarba) for giving me the NPM name. 102 | 103 | ## License 104 | 105 | [MIT License](http://opensource.org/licenses/mit-license.html). © Joel Arvidsson 2015- 106 | -------------------------------------------------------------------------------- /Shapes/Arc.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Path } from 'react-native-svg'; 4 | 5 | const CIRCLE = Math.PI * 2; 6 | 7 | function makeArcPath(x, y, startAngleArg, endAngleArg, radius, direction) { 8 | let startAngle = startAngleArg; 9 | let endAngle = endAngleArg; 10 | if (endAngle - startAngle >= CIRCLE) { 11 | endAngle = CIRCLE + (endAngle % CIRCLE); 12 | } else { 13 | endAngle = endAngle % CIRCLE; 14 | } 15 | startAngle = startAngle % CIRCLE; 16 | const angle = 17 | startAngle > endAngle 18 | ? CIRCLE - startAngle + endAngle 19 | : endAngle - startAngle; 20 | 21 | if (angle >= CIRCLE) { 22 | return `M${x + radius} ${y} 23 | a${radius} ${radius} 0 0 1 0 ${radius * 2} 24 | a${radius} ${radius} 0 0 1 0 ${radius * -2}`; 25 | } 26 | 27 | const directionFactor = direction === 'counter-clockwise' ? -1 : 1; 28 | endAngle *= directionFactor; 29 | startAngle *= directionFactor; 30 | const startSine = Math.sin(startAngle); 31 | const startCosine = Math.cos(startAngle); 32 | const endSine = Math.sin(endAngle); 33 | const endCosine = Math.cos(endAngle); 34 | 35 | const arcFlag = angle > Math.PI ? 1 : 0; 36 | const reverseFlag = direction === 'counter-clockwise' ? 0 : 1; 37 | 38 | return `M${x + radius * (1 + startSine)} ${y + radius - radius * startCosine} 39 | A${radius} ${radius} 0 ${arcFlag} ${reverseFlag} ${x + 40 | radius * (1 + endSine)} ${y + radius - radius * endCosine}`; 41 | } 42 | 43 | export default class Arc extends Component { 44 | static propTypes = { 45 | startAngle: PropTypes.number.isRequired, // in radians 46 | endAngle: PropTypes.number.isRequired, // in radians 47 | radius: PropTypes.number.isRequired, 48 | offset: PropTypes.shape({ 49 | top: PropTypes.number, 50 | left: PropTypes.number, 51 | }), 52 | strokeCap: PropTypes.string, 53 | strokeWidth: PropTypes.number, 54 | direction: PropTypes.oneOf(['clockwise', 'counter-clockwise']), 55 | }; 56 | 57 | static defaultProps = { 58 | startAngle: 0, 59 | offset: { top: 0, left: 0 }, 60 | strokeCap: 'butt', 61 | strokeWidth: 0, 62 | direction: 'clockwise', 63 | }; 64 | 65 | render() { 66 | const { 67 | startAngle, 68 | endAngle, 69 | radius, 70 | offset, 71 | direction, 72 | strokeCap, 73 | strokeWidth, 74 | ...restProps 75 | } = this.props; 76 | 77 | const path = makeArcPath( 78 | (offset.left || 0) + strokeWidth / 2, 79 | (offset.top || 0) + strokeWidth / 2, 80 | startAngle, 81 | endAngle, 82 | radius - strokeWidth / 2, 83 | direction 84 | ); 85 | 86 | return ( 87 | 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Shapes/Circle.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Path } from 'react-native-svg'; 4 | 5 | function makeCirclePath(x, y, radius, direction) { 6 | const reverseFlag = direction === 'counter-clockwise' ? 0 : 1; 7 | 8 | return `M${x} ${y} 9 | m${radius} 0 10 | a${radius} ${radius} 0 0 ${reverseFlag} 0 ${radius * 2} 11 | a${radius} ${radius} 0 0 ${reverseFlag} 0 ${radius * -2}`; 12 | } 13 | 14 | export default class Circle extends Component { 15 | static propTypes = { 16 | radius: PropTypes.number.isRequired, 17 | offset: PropTypes.shape({ 18 | top: PropTypes.number, 19 | left: PropTypes.number, 20 | }), 21 | strokeWidth: PropTypes.number, 22 | direction: PropTypes.oneOf(['clockwise', 'counter-clockwise']), 23 | }; 24 | 25 | static defaultProps = { 26 | offset: { top: 0, left: 0 }, 27 | strokeWidth: 0, 28 | direction: 'clockwise', 29 | }; 30 | 31 | render() { 32 | const { radius, offset, strokeWidth, direction, ...restProps } = this.props; 33 | const path = makeCirclePath( 34 | (offset.left || 0) + strokeWidth / 2, 35 | (offset.top || 0) + strokeWidth / 2, 36 | radius - strokeWidth / 2, 37 | direction 38 | ); 39 | return ( 40 | 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Shapes/Sector.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Path } from 'react-native-svg'; 4 | 5 | const CIRCLE = Math.PI * 2; 6 | 7 | function makeSectorPath(x, y, angle, radius) { 8 | if (angle >= CIRCLE) { 9 | return `M${x} ${y} 10 | m${radius} 0 11 | a${radius} ${radius} 0 0 1 0 ${radius * 2} 12 | a${radius} ${radius} 0 0 1 0 ${radius * -2}`; 13 | } 14 | 15 | const startAngle = Math.PI / 2 - angle; 16 | const endAngle = Math.PI / 2; 17 | const arcFlag = angle > Math.PI ? 1 : 0; 18 | const centerX = x + radius; 19 | const centerY = y + radius; 20 | 21 | return `M${centerX} ${centerY} 22 | L${centerX + Math.cos(startAngle) * radius} ${centerY - 23 | Math.sin(startAngle) * radius} 24 | A${radius} ${radius} 0 ${arcFlag} 0 ${centerX + 25 | Math.cos(endAngle) * radius} ${centerY - Math.sin(endAngle) * radius} 26 | L${centerX} ${centerY}`; 27 | } 28 | 29 | export default class Sector extends Component { 30 | static propTypes = { 31 | angle: PropTypes.number.isRequired, // in radians 32 | radius: PropTypes.number.isRequired, 33 | offset: PropTypes.shape({ 34 | top: PropTypes.number, 35 | left: PropTypes.number, 36 | }), 37 | }; 38 | 39 | static defaultProps = { 40 | offset: { top: 0, left: 0 }, 41 | }; 42 | 43 | render() { 44 | const { angle, radius, offset, ...restProps } = this.props; 45 | const path = makeSectorPath( 46 | offset.left || 0, 47 | offset.top || 0, 48 | angle, 49 | radius 50 | ); 51 | return ; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'react-native-progress' { 2 | import React from 'react'; 3 | import { TextStyle, ViewProperties } from 'react-native'; 4 | 5 | /** 6 | * Properties for all `Progress` components. 7 | * 8 | * @export 9 | * @interface DefaultPropTypes 10 | * @extends {ViewProperties} 11 | */ 12 | export interface DefaultPropTypes extends ViewProperties { 13 | /** 14 | * Whether or not to animate changes to progress. 15 | * 16 | * @type {boolean} 17 | * @memberof DefaultPropTypes 18 | * @default true 19 | */ 20 | animated?: boolean; 21 | 22 | /** 23 | * If set to true, the indicator will spin and progress prop will be ignored. 24 | * 25 | * @type {boolean} 26 | * @memberof DefaultPropTypes 27 | * @default false 28 | */ 29 | indeterminate?: boolean; 30 | 31 | /** 32 | * Sets animation duration in milliseconds when indeterminate is set. 33 | * 34 | * @type {number} 35 | * @memberof BarPropTypes 36 | * @default 1000 37 | */ 38 | indeterminateAnimationDuration?: number; 39 | 40 | /** 41 | * Progress of whatever the indicator is indicating. A number between `0` and `1` 42 | * 43 | * @type {(0 | 1)} 44 | * @memberof DefaultPropTypes 45 | * @default 0 46 | */ 47 | progress?: number; 48 | 49 | /** 50 | * Fill color of the indicator. 51 | * 52 | * @type {string} 53 | * @memberof DefaultPropTypes 54 | * @default rgba(0, 122, 255, 1) 55 | */ 56 | color?: string; 57 | 58 | /** 59 | * Color of the remaining progress. 60 | * 61 | * @type {string} 62 | * @memberof DefaultPropTypes 63 | * @default None 64 | */ 65 | unfilledColor?: string; 66 | 67 | /** 68 | * Width of outer border, set to `0` to remove. 69 | * 70 | * @type {number} 71 | * @memberof DefaultPropTypes 72 | * @default 1 73 | */ 74 | borderWidth?: number; 75 | 76 | /** 77 | * Color of outer border. 78 | * 79 | * @type {string} 80 | * @memberof DefaultPropTypes 81 | * @default color 82 | */ 83 | borderColor?: string; 84 | } 85 | 86 | /** 87 | * Properties for `Bar` components 88 | * 89 | * @export 90 | * @interface BarPropTypes 91 | * @extends {DefaultPropTypes} 92 | */ 93 | export interface BarPropTypes extends DefaultPropTypes { 94 | /** 95 | * Full width of the progress bar, set to null to use automatic flexbox sizing. 96 | * 97 | * @type {number} 98 | * @memberof BarPropTypes 99 | * @default 150 100 | */ 101 | width?: number | null; 102 | 103 | /** 104 | * Height of the progress bar. 105 | * 106 | * @type {number} 107 | * @memberof BarPropTypes 108 | * @default 6 109 | */ 110 | height?: number; 111 | 112 | /** 113 | * Rounding of corners, set to `0` to disable. 114 | * 115 | * @type {number} 116 | * @memberof BarPropTypes 117 | * @default 4 118 | */ 119 | borderRadius?: number; 120 | 121 | /** 122 | * Use native driver for the animations. 123 | * 124 | * @type {boolean} 125 | * @memberof BarPropTypes 126 | * @default false 127 | */ 128 | useNativeDriver?: boolean; 129 | 130 | /** 131 | * Config that is passed into the Animated function 132 | * 133 | * @type {{}} 134 | * @memberof BarPropTypes 135 | * @default { bounciness: 0 } 136 | */ 137 | animationConfig?: {}; 138 | 139 | /** 140 | * Animation type to animate the progress, one of: `decay`, `timing`, `spring` 141 | * 142 | * @type {('decay' | 'timing' | 'spring')} 143 | * @memberof BarPropTypes 144 | * @default spring 145 | */ 146 | animationType?: 'decay' | 'timing' | 'spring'; 147 | } 148 | 149 | /** 150 | * Properties for `Circle` components 151 | * 152 | * @export 153 | * @interface CirclePropTypes 154 | * @extends {DefaultPropTypes} 155 | */ 156 | export interface CirclePropTypes extends DefaultPropTypes { 157 | /** 158 | * Diameter of the circle. 159 | * 160 | * @type {number} 161 | * @memberof CirclePropTypes 162 | * @default 40 163 | */ 164 | size?: number; 165 | 166 | /** 167 | * Thickness of the inner circle. 168 | * 169 | * @type {number} 170 | * @memberof CirclePropTypes 171 | * @default 3 172 | */ 173 | thickness?: number; 174 | 175 | /** 176 | * Whether or not to show a text representation of current progress. 177 | * 178 | * @type {boolean} 179 | * @memberof CirclePropTypes 180 | * @default false 181 | */ 182 | showsText?: boolean; 183 | 184 | /** 185 | * A function returning a string to be displayed for the textual representation. 186 | * 187 | * @memberof CirclePropTypes 188 | * @default See source 189 | */ 190 | formatText?: (progress: number) => void; 191 | 192 | /** 193 | * Styles for progress text, defaults to a same `color` as circle and `fontSize` proportional to `size` prop. 194 | * 195 | * @type {TextStyle} 196 | * @memberof CirclePropTypes 197 | * @default None 198 | */ 199 | textStyle?: TextStyle; 200 | 201 | /** 202 | * Whether or not to respect device font scale setting. 203 | * 204 | * @type {boolean} 205 | * @memberof CirclePropTypes 206 | * @default true 207 | */ 208 | allowFontScaling?: boolean; 209 | 210 | /** 211 | * Direction of the circle `clockwise` or `counter-clockwise`. 212 | * 213 | * @type {('clockwise' | 'counter-clockwise')} 214 | * @memberof CirclePropTypes 215 | * @default clockwise 216 | */ 217 | direction?: 'clockwise' | 'counter-clockwise'; 218 | 219 | /** 220 | * Stroke Cap style for the circle `butt`, `square` or `round`. 221 | * 222 | * @type {('butt' | 'square' | 'round')} 223 | * @memberof CirclePropTypes 224 | * @default butt 225 | */ 226 | strokeCap?: 'butt' | 'square' | 'round'; 227 | 228 | /** 229 | * Fill color of the inner circle. 230 | * 231 | * @type {string} 232 | * @memberof CirclePropTypes 233 | * @default None 234 | */ 235 | fill?: string; 236 | 237 | /** 238 | * Determines the endAngle of the circle. 239 | * 240 | * @type {number} 241 | * @memberof CirclePropTypes 242 | * @default 0.9 243 | */ 244 | endAngle?: number; 245 | } 246 | 247 | /** 248 | * Properties for `PiePropTypes` components 249 | * 250 | * @export 251 | * @interface PiePropTypes 252 | * @extends {DefaultPropTypes} 253 | */ 254 | export interface PiePropTypes extends DefaultPropTypes { 255 | /** 256 | * Diameter of the pie. 257 | * 258 | * @type {number} 259 | * @memberof PiePropTypes 260 | * @default 40 261 | */ 262 | size?: number; 263 | } 264 | 265 | /** 266 | * Properties for `CircleSnailPropTypes` components 267 | * 268 | * @export 269 | * @interface CircleSnailPropTypes 270 | * @extends {DefaultPropTypes} 271 | */ 272 | export interface CircleSnailPropTypes extends Omit { 273 | /** 274 | * If the circle should animate. 275 | * 276 | * @type {boolean} 277 | * @memberof CircleSnailPropTypes 278 | * @default true 279 | */ 280 | animating?: boolean; 281 | 282 | /** 283 | * If the circle should be removed when not animating. 284 | * 285 | * @type {boolean} 286 | * @memberof CircleSnailPropTypes 287 | * @default true 288 | */ 289 | hidesWhenStopped?: boolean; 290 | 291 | /** 292 | * Diameter of the circle. 293 | * 294 | * @type {number} 295 | * @memberof CircleSnailPropTypes 296 | * @default 40 297 | */ 298 | size?: number; 299 | 300 | /** 301 | * Color of the circle, use an array of colors for rainbow effect. 302 | * 303 | * @type {string | string[]} 304 | * @memberof CircleSnailPropTypes 305 | * @default rgba(0, 122, 255, 1) 306 | */ 307 | color?: string | string[]; 308 | 309 | /** 310 | * Thickness of the circle. 311 | * 312 | * @type {number} 313 | * @memberof CircleSnailPropTypes 314 | * @default 3 315 | */ 316 | thickness?: number; 317 | 318 | /** 319 | * Duration of animation. 320 | * 321 | * @type {number} 322 | * @memberof CircleSnailPropTypes 323 | * @default 1000 324 | */ 325 | duration?: number; 326 | 327 | /** 328 | * Duration of spin (orbit) animation. 329 | * 330 | * @type {number} 331 | * @memberof CircleSnailPropTypes 332 | * @default 5000 333 | */ 334 | spinDuration?: number; 335 | 336 | /** 337 | * Stroke Cap style for the circle `butt`, `square` or `round` 338 | * 339 | * @type {('butt' | 'square' | 'round')} 340 | * @memberof CircleSnailPropTypes 341 | * @default round 342 | */ 343 | strokeCap?: 'butt' | 'square' | 'round'; 344 | 345 | /** 346 | * Direction in which the circle spins, either "clockwise" or "counter-clockwise" (default). 347 | * 348 | * @type {('clockwise' | 'counter-clockwise')} 349 | * @memberof CircleSnailPropTypes 350 | * @default counter-clockwise 351 | */ 352 | direction?: 'clockwise' | 'counter-clockwise'; 353 | } 354 | 355 | export class Bar extends React.Component {} 356 | export class Circle extends React.Component {} 357 | export class Pie extends React.Component {} 358 | export class CircleSnail extends React.Component {} 359 | } 360 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | export { default as Bar } from './Bar'; 2 | export { default as Circle } from './Circle'; 3 | export { default as CircleSnail } from './CircleSnail'; 4 | export { default as Pie } from './Pie'; 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-progress", 3 | "version": "5.0.0", 4 | "description": "Progress indicators and spinners for React Native using ReactART", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "eslint *.js Shapes", 8 | "format": "./node_modules/.bin/prettier --write {,Shapes/,Example/}*.js README.md *.ts" 9 | }, 10 | "keywords": [ 11 | "react-native", 12 | "react-component", 13 | "react-native-component", 14 | "react", 15 | "mobile", 16 | "ios", 17 | "ui", 18 | "progress", 19 | "progressindicator", 20 | "circle", 21 | "pie", 22 | "bar", 23 | "progressbar", 24 | "indeterminate", 25 | "spinner", 26 | "animation" 27 | ], 28 | "author": { 29 | "name": "Joel Arvidsson", 30 | "email": "joel@oblador.se" 31 | }, 32 | "homepage": "https://github.com/oblador/react-native-progress", 33 | "bugs": { 34 | "url": "https://github.com/oblador/react-native-progress/issues" 35 | }, 36 | "repository": { 37 | "type": "git", 38 | "url": "git://github.com/oblador/react-native-progress.git" 39 | }, 40 | "license": "MIT", 41 | "devDependencies": { 42 | "babel-eslint": "^10.0.1", 43 | "eslint": "5.3.0", 44 | "eslint-config-airbnb": "17.1.0", 45 | "eslint-config-prettier": "^4.1.0", 46 | "eslint-plugin-import": "^2.14.0", 47 | "eslint-plugin-jsx-a11y": "^6.1.1", 48 | "eslint-plugin-prettier": "^3.0.1", 49 | "eslint-plugin-react": "^7.11.0", 50 | "prettier": "^1.16.4", 51 | "react-native-svg": "^12.1.1" 52 | }, 53 | "dependencies": { 54 | "prop-types": "^15.7.2" 55 | }, 56 | "peerDependencies": { 57 | "react-native-svg": "*" 58 | }, 59 | "typings": "index.d.ts" 60 | } 61 | -------------------------------------------------------------------------------- /withAnimation.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Animated, Easing } from 'react-native'; 4 | 5 | export default function withAnimation(WrappedComponent, indeterminateProgress) { 6 | const wrappedComponentName = 7 | WrappedComponent.displayName || WrappedComponent.name || 'Component'; 8 | 9 | return class AnimatedComponent extends Component { 10 | static displayName = `withAnimation(${wrappedComponentName})`; 11 | 12 | static propTypes = { 13 | animated: PropTypes.bool, 14 | direction: PropTypes.oneOf(['clockwise', 'counter-clockwise']), 15 | indeterminate: PropTypes.bool, 16 | indeterminateAnimationDuration: PropTypes.number, 17 | progress: PropTypes.number, 18 | }; 19 | 20 | static defaultProps = { 21 | animated: true, 22 | indeterminateAnimationDuration: 1000, 23 | indeterminate: false, 24 | progress: 0, 25 | }; 26 | 27 | constructor(props) { 28 | super(props); 29 | 30 | this.progressValue = Math.min(Math.max(props.progress, 0), 1); 31 | this.rotationValue = 0; 32 | this.state = { 33 | progress: new Animated.Value(this.progressValue), 34 | rotation: new Animated.Value(this.rotationValue), 35 | }; 36 | } 37 | 38 | componentDidMount() { 39 | this.state.progress.addListener(event => { 40 | this.progressValue = event.value; 41 | }); 42 | this.state.rotation.addListener(event => { 43 | this.rotationValue = event.value; 44 | }); 45 | if (this.props.indeterminate) { 46 | this.spin(); 47 | if (indeterminateProgress) { 48 | Animated.spring(this.state.progress, { 49 | toValue: indeterminateProgress, 50 | useNativeDriver: false 51 | }).start(); 52 | } 53 | } 54 | } 55 | 56 | componentDidUpdate(prevProps) { 57 | if (prevProps.indeterminate !== this.props.indeterminate) { 58 | if (this.props.indeterminate) { 59 | this.spin(); 60 | } else { 61 | Animated.spring(this.state.rotation, { 62 | toValue: this.rotationValue > 0.5 ? 1 : 0, 63 | useNativeDriver: false 64 | }).start(endState => { 65 | if (endState.finished) { 66 | this.state.rotation.setValue(0); 67 | } 68 | }); 69 | } 70 | } 71 | const progress = this.props.indeterminate 72 | ? indeterminateProgress || 0 73 | : Math.min(Math.max(this.props.progress, 0), 1); 74 | if (progress !== this.progressValue) { 75 | if (this.props.animated) { 76 | Animated.spring(this.state.progress, { 77 | toValue: progress, 78 | bounciness: 0, 79 | useNativeDriver: false 80 | }).start(); 81 | } else { 82 | this.state.progress.setValue(progress); 83 | } 84 | } 85 | } 86 | 87 | componentWillUnmount() { 88 | this.state.progress.removeAllListeners(); 89 | this.state.rotation.removeAllListeners(); 90 | } 91 | 92 | spin() { 93 | this.state.rotation.setValue(0); 94 | Animated.timing(this.state.rotation, { 95 | toValue: this.props.direction === 'counter-clockwise' ? -1 : 1, 96 | duration: this.props.indeterminateAnimationDuration, 97 | easing: Easing.linear, 98 | isInteraction: false, 99 | useNativeDriver: false 100 | }).start(endState => { 101 | if (endState.finished) { 102 | this.spin(); 103 | } 104 | }); 105 | } 106 | 107 | render() { 108 | return ( 109 | 116 | ); 117 | } 118 | }; 119 | } 120 | --------------------------------------------------------------------------------