react-native-pdf-view
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "react-native-pdf-view", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "view pdf file using react-native", | ||
@@ -5,0 +5,0 @@ "main": "PDFView.js", |
# react-native-pdf-view | ||
React Native PDF View | ||
React Native PDF View (Android Only) | ||
### Installation | ||
@@ -8,3 +9,53 @@ ```bash | ||
``` | ||
* In `android/setting.gradle` | ||
```gradle | ||
... | ||
include ':PDFView' | ||
project(':PDFView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pdf-view/android') | ||
``` | ||
* In `android/app/build.gradle` | ||
```gradle | ||
... | ||
dependencies { | ||
... | ||
compile project(':PDFView') | ||
} | ||
``` | ||
* register module (in MainActivity.java) | ||
```java | ||
import com.keyee.pdfview.PDFView; // <--- import | ||
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { | ||
...... | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
mReactRootView = new ReactRootView(this); | ||
mReactInstanceManager = ReactInstanceManager.builder() | ||
.setApplication(getApplication()) | ||
.setBundleAssetName("index.android.bundle") | ||
.setJSMainModuleName("index.android") | ||
.addPackage(new MainReactPackage()) | ||
.addPackage(new PDFView()) // <------ add here | ||
.setUseDeveloperSupport(BuildConfig.DEBUG) | ||
.setInitialLifecycleState(LifecycleState.RESUMED) | ||
.build(); | ||
mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null); | ||
setContentView(mReactRootView); | ||
} | ||
...... | ||
} | ||
``` | ||
### Usage | ||
@@ -11,0 +62,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79482214
113