Skip to content

Commit f2fbfc2

Browse files
authored
Migrate the AndroidProgressBar module from React Native core to the community repo (#1)
Migrate the AndroidProgressBar module from React Native core to the community repo
2 parents 62364e2 + 6b9e386 commit f2fbfc2

File tree

90 files changed

+17653
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+17653
-1
lines changed

.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: "@react-native-community" };

.flowconfig

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
22+
[include]
23+
24+
[libs]
25+
node_modules/react-native/Libraries/react-native/react-native-interface.js
26+
node_modules/react-native/flow/
27+
28+
[options]
29+
emoji=true
30+
31+
esproposal.optional_chaining=enable
32+
esproposal.nullish_coalescing=enable
33+
34+
module.system=haste
35+
module.system.haste.use_name_reducers=true
36+
# get basename
37+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
38+
# strip .js or .js.flow suffix
39+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
40+
# strip .ios suffix
41+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
42+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
44+
module.system.haste.paths.blacklist=.*/__tests__/.*
45+
module.system.haste.paths.blacklist=.*/__mocks__/.*
46+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
47+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
48+
49+
munge_underscores=true
50+
51+
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\)$' -> 'RelativeImageStub'
52+
53+
module.file_ext=.js
54+
module.file_ext=.jsx
55+
module.file_ext=.json
56+
module.file_ext=.native.js
57+
58+
suppress_type=$FlowIssue
59+
suppress_type=$FlowFixMe
60+
suppress_type=$FlowFixMeProps
61+
suppress_type=$FlowFixMeState
62+
63+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
64+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
65+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
66+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
67+
68+
[version]
69+
^0.92.0

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
.project
5+
6+
# Xcode
7+
#
8+
build/
9+
*.pbxuser
10+
!default.pbxuser
11+
*.mode1v3
12+
!default.mode1v3
13+
*.mode2v3
14+
!default.mode2v3
15+
*.perspectivev3
16+
!default.perspectivev3
17+
xcuserdata
18+
*.xccheckout
19+
*.moved-aside
20+
DerivedData
21+
*.hmap
22+
*.ipa
23+
*.xcuserstate
24+
project.xcworkspace
25+
Pods/
26+
27+
# Android/IJ
28+
#
29+
.idea
30+
*.iml
31+
.gradle
32+
local.properties
33+
lib/android/src/main/gen
34+
35+
# node.js
36+
#
37+
node_modules/
38+
npm-debug.log
39+
yarn-error.log
40+
package-lock.json
41+
42+
# Rubygem bundles
43+
#
44+
bundles/
45+
46+
# VS Code
47+
.vscode/*
48+
!.vscode/settings.json
49+
!.vscode/tasks.json
50+
!.vscode/launch.json
51+
!.vscode/extensions.json
52+
53+
android/gradle
54+
android/gradlew
55+
android/gradlew.bat

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"requirePragma": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"bracketSpacing": false,
6+
"jsxBracketSameLine": true
7+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive"
3+
}

README.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
# react-native-progress-bar-android
1+
2+
# react-native-androidprogressbar
3+
4+
## Getting started
5+
6+
`$ npm install react-native-androidprogressbar --save`
7+
8+
## Example setup
9+
10+
### Android
11+
1. Install dependencies
12+
2. Start the server
13+
3. Build the application
14+
```
15+
npm install
16+
npm run start
17+
npm run build:android
18+
```
19+
20+
### Mostly automatic installation
21+
22+
`$ react-native link react-native-androidprogressbar`
23+
24+
### Manual installation
25+
26+
27+
#### iOS
28+
29+
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
30+
2. Go to `node_modules``react-native-androidprogressbar` and add `RNCAndroidprogressbar.xcodeproj`
31+
3. In XCode, in the project navigator, select your project. Add `libRNCAndroidprogressbar.a` to your project's `Build Phases``Link Binary With Libraries`
32+
4. Run your project (`Cmd+R`)<
33+
34+
#### Android
35+
36+
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
37+
- Add `import com.reactnativecommunity.androidprogressbar.RNCAndroidprogressbarPackage;` to the imports at the top of the file
38+
- Add `new RNCAndroidprogressbarPackage()` to the list returned by the `getPackages()` method
39+
2. Append the following lines to `android/settings.gradle`:
40+
```
41+
include ':react-native-androidprogressbar'
42+
project(':react-native-androidprogressbar').projectDir = new File(rootProject.projectDir, '../../node_modules/react-native-androidprogressbar/android')
43+
```
44+
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
45+
```
46+
compile project(':react-native-androidprogressbar')
47+
```
48+
49+
50+
## Usage
51+
```javascript
52+
import RNCAndroidprogressbar from 'react-native-androidprogressbar';
53+
54+
// TODO: What to do with the module?
55+
RNCAndroidprogressbar;
56+
```
57+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=../example/android
2+
eclipse.preferences.version=1

android/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
}
6+
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:1.3.1'
9+
}
10+
}
11+
12+
apply plugin: 'com.android.library'
13+
14+
android {
15+
compileSdkVersion 26
16+
17+
defaultConfig {
18+
minSdkVersion 16
19+
targetSdkVersion 26
20+
versionCode 1
21+
versionName "1.0"
22+
}
23+
lintOptions {
24+
abortOnError false
25+
}
26+
}
27+
28+
repositories {
29+
mavenCentral()
30+
}
31+
32+
dependencies {
33+
implementation 'com.facebook.react:react-native:+'
34+
}
35+

android/src/main/AndroidManifest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.reactnativecommunity.androidprogressbar">
4+
5+
</manifest>
6+

0 commit comments

Comments
 (0)