diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4ed60d --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Pdf-View + +## ScreenShots + + +## Implementation + +### build.gradle +``` +repositories { + maven { url "https://jitpack.io" } +} + +``` +### [module]/build.gradle + +``` +version latest: 1.0.0-alpha2 + +dependencies { + implementation 'com.github.longdt57:Pdf-View:{version}' +} +``` + +## Usage +### 1. PdfView +``` + +``` +- Set Data by Uri: `pdfView.setUri(...)` +- Set Data by PdfRenderer: `pdfView.setPdfRenderer(renderer)` + +### 2. Open Pdf File +``` +// pdf file Uri +val uri = ... + +Intent(Intent.ACTION_VIEW).apply { + val type = "application/pdf" + setDataAndType(uri, type) + addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + startActivity(this) +} +``` + +## References: +- https://github.com/Baseflow/PhotoView