Skip to content

Commit 19f3c5b

Browse files
authored
Merge pull request #1 from nyu-ossd-s19/SimpleExample
Simple example
2 parents 1b4a7f2 + 55f9705 commit 19f3c5b

18 files changed

+6691
-162
lines changed

.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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55

66
`$ npm install react-native-androidprogressbar --save`
77

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+
820
### Mostly automatic installation
921

1022
`$ react-native link react-native-androidprogressbar`
@@ -42,4 +54,4 @@ import RNCAndroidprogressbar from 'react-native-androidprogressbar';
4254
// TODO: What to do with the module?
4355
RNCAndroidprogressbar;
4456
```
45-
57+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
connection.project.dir=
1+
connection.project.dir=../example/android
22
eclipse.preferences.version=1

android/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ buildscript {
1212
apply plugin: 'com.android.library'
1313

1414
android {
15-
compileSdkVersion 23
16-
buildToolsVersion "23.0.1"
15+
compileSdkVersion 26
1716

1817
defaultConfig {
1918
minSdkVersion 16
20-
targetSdkVersion 22
19+
targetSdkVersion 26
2120
versionCode 1
2221
versionName "1.0"
2322
}
@@ -31,6 +30,6 @@ repositories {
3130
}
3231

3332
dependencies {
34-
compile 'com.facebook.react:react-native:+'
33+
implementation 'com.facebook.react:react-native:+'
3534
}
3635

example/ProgressBarAndroidExample.android.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
var ProgressBar = require('../../Libraries/Components/ProgressBarAndroid/ProgressBarAndroid');
13+
var ProgressBar = require('../js/RNCProgressBarAndroid.android');
1414
var React = require('react');
1515
var createReactClass = require('create-react-class');
1616
var RNTesterBlock = require('./RNTesterBlock');
@@ -40,7 +40,7 @@ var MovingBar = createReactClass({
4040
},
4141
});
4242

43-
class ProgressBarAndroidExample extends React.Component<{}> {
43+
export default class ProgressBarAndroidExample extends React.Component<{}> {
4444
static title = '<ProgressBarAndroid>';
4545
static description = 'Horizontal bar to show the progress of some operation.';
4646

example/android/app/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=..
2+
eclipse.preferences.version=1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=13
3+
org.eclipse.jdt.core.compiler.compliance=13
4+
org.eclipse.jdt.core.compiler.source=13

example/android/app/BUCK

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ android_library(
3535

3636
android_build_config(
3737
name = "build_config",
38-
package = "com.androidprogressbarexample",
38+
package = "com.androidprogressbar",
3939
)
4040

4141
android_resource(
4242
name = "res",
43-
package = "com.androidprogressbarexample",
43+
package = "com.androidprogressbar",
4444
res = "src/main/res",
4545
)
4646

example/android/app/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ import com.android.build.OutputFile
7373
*/
7474

7575
project.ext.react = [
76-
entryFile: "example/index.js"
76+
entryFile: "index.js"
7777
]
7878

79-
apply from: "../../../../node_modules/react-native/react.gradle"
79+
apply from: "../../../node_modules/react-native/react.gradle"
8080

8181
/**
8282
* Set this to true to create two separate APKs instead of one:
@@ -102,7 +102,7 @@ android {
102102
}
103103

104104
defaultConfig {
105-
applicationId "com.androidprogressbarexample"
105+
applicationId "com.androidprogressbar"
106106
minSdkVersion rootProject.ext.minSdkVersion
107107
targetSdkVersion rootProject.ext.targetSdkVersion
108108
versionCode 1
@@ -141,7 +141,6 @@ dependencies {
141141
implementation fileTree(dir: "libs", include: ["*.jar"])
142142
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143143
implementation "com.facebook.react:react-native:+" // From node_modules
144-
implementation project(':react-native-progress-bar-android')
145144
}
146145

147146
// Run this once to be able to run the application with BUCK

0 commit comments

Comments
 (0)