Skip to content

Commit e7936b9

Browse files
authored
docs: add Android manual linking instructions (#26)
1 parent 7da2bcd commit e7936b9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,52 @@ For now, this module only works for Android. Under the hood it is using the nati
1818

1919
`react-native link @react-native-community/viewpager`
2020

21+
### Manual installation
22+
23+
#### iOS
24+
Not Supported.
25+
26+
#### Android
27+
28+
<details>
29+
<summary>Manually link the library on Android</summary>
30+
</br>
31+
Make the following changes:
32+
33+
#### `android/settings.gradle`
34+
```groovy
35+
include ':@react-native-community_viewpager'
36+
project(':@react-native-community_viewpager').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/viewpager/android')
37+
```
38+
39+
#### `android/app/build.gradle`
40+
```groovy
41+
dependencies {
42+
...
43+
implementation project(':@react-native-community_viewpager')
44+
}
45+
```
46+
47+
#### `android/app/src/main/.../MainApplication.java`
48+
On top, where imports are:
49+
50+
```java
51+
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
52+
```
53+
54+
Add the `RNCViewPagerPackage` class to your list of exported packages.
55+
56+
```java
57+
@Override
58+
protected List<ReactPackage> getPackages() {
59+
return Arrays.<ReactPackage>asList(
60+
new MainReactPackage(),
61+
new RNCViewPagerPackage()
62+
);
63+
}
64+
```
65+
</details>
66+
2167
## Usage
2268

2369
```js

0 commit comments

Comments
 (0)