update required RN version and Android installation instructions
This commit is contained in:
parent
1e5470b475
commit
abe8c03968
37
README.md
37
README.md
|
@ -3,7 +3,7 @@
|
||||||
A `<LinearGradient>` component for react-native, as seen in
|
A `<LinearGradient>` component for react-native, as seen in
|
||||||
[react-native-login](https://github.com/brentvatne/react-native-login).
|
[react-native-login](https://github.com/brentvatne/react-native-login).
|
||||||
|
|
||||||
Version 1.3.0 supports react-native >= 0.16.0
|
Version 1.5.0 supports react-native >= 0.19.0
|
||||||
|
|
||||||
## Add it to your project
|
## Add it to your project
|
||||||
|
|
||||||
|
@ -36,8 +36,9 @@ or do it manually as described below:
|
||||||
|
|
||||||
1. in `android/settings.gradle`
|
1. in `android/settings.gradle`
|
||||||
```
|
```
|
||||||
include ':app', ':react-native-linear-gradient'
|
...
|
||||||
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
|
include ':react-native-linear-gradient'
|
||||||
|
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
|
||||||
```
|
```
|
||||||
|
|
||||||
2. in `android/app/build.gradle` add:
|
2. in `android/app/build.gradle` add:
|
||||||
|
@ -49,29 +50,17 @@ or do it manually as described below:
|
||||||
```
|
```
|
||||||
|
|
||||||
3. and finally, in `android/src/main/java/com/{YOUR_APP_NAME}/MainActivity.java` add:
|
3. and finally, in `android/src/main/java/com/{YOUR_APP_NAME}/MainActivity.java` add:
|
||||||
```
|
```java
|
||||||
...
|
//...
|
||||||
import com.BV.LinearGradient.LinearGradientPackage; // <--- This!
|
import com.BV.LinearGradient.LinearGradientPackage; // <--- This!
|
||||||
...
|
//...
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected List<ReactPackage> getPackages() {
|
||||||
super.onCreate(savedInstanceState);
|
return Arrays.<ReactPackage>asList(
|
||||||
mReactRootView = new ReactRootView(this);
|
new MainReactPackage(),
|
||||||
|
new LinearGradientPackage() // <---- and This!
|
||||||
mReactInstanceManager = ReactInstanceManager.builder()
|
);
|
||||||
.setApplication(getApplication())
|
}
|
||||||
.setBundleAssetName("index.android.bundle")
|
|
||||||
.setJSMainModuleName("index.android")
|
|
||||||
.addPackage(new MainReactPackage())
|
|
||||||
.addPackage(new LinearGradientPackage()) // <---- and This!
|
|
||||||
.setUseDeveloperSupport(BuildConfig.DEBUG)
|
|
||||||
.setInitialLifecycleState(LifecycleState.RESUMED)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
mReactRootView.startReactApplication(mReactInstanceManager, "SillyGoose", null);
|
|
||||||
|
|
||||||
setContentView(mReactRootView);
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
Loading…
Reference in New Issue