2018-04-25 03:05:16 -04:00
|
|
|
# Installation (Manual)
|
|
|
|
|
|
|
|
## iOS
|
|
|
|
|
2018-04-25 03:07:13 -04:00
|
|
|
- In Xcode:
|
|
|
|
- Add `FastImage.xcodeproj` to **Libraries**.
|
|
|
|
- Add `libFastImage.a` to **Link Binary With Libraries** under **Build Phases**.
|
|
|
|
- [More info and screenshots.](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content)
|
2018-04-25 03:05:16 -04:00
|
|
|
|
|
|
|
## Android
|
|
|
|
|
|
|
|
* Edit `android/settings.gradle`
|
|
|
|
|
|
|
|
```diff
|
|
|
|
rootProject.name = 'MyApp'
|
|
|
|
|
|
|
|
include ':app'
|
|
|
|
|
|
|
|
+ include ':react-native-fast-image'
|
|
|
|
+ project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
|
|
|
|
```
|
|
|
|
|
|
|
|
* Edit `android/app/build.gradle`
|
|
|
|
|
|
|
|
```diff
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
android {
|
|
|
|
...
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2018-11-13 18:47:18 +01:00
|
|
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
|
|
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
|
|
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
|
|
+ implementation project(':react-native-fast-image')
|
2018-04-25 03:05:16 -04:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
* Edit `android/app/src/main/java/.../MainApplication.java`
|
|
|
|
|
|
|
|
```diff
|
|
|
|
package com.myapp;
|
|
|
|
|
|
|
|
+ import com.dylanvann.fastimage.FastImageViewPackage;
|
|
|
|
|
|
|
|
....
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected List<ReactPackage> getPackages() {
|
|
|
|
return Arrays.<ReactPackage>asList(
|
|
|
|
new MainReactPackage()
|
|
|
|
+ ,new FastImageViewPackage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
```
|