Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Pdf Viewer with Supporting Android API >=21 #1177

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 3.2.4 (2024-03-19)
* Update [PdfiumAndroid library](https://github.com/lion1988dev/PdfiumAndroid) to 1.9.4

## 3.2.3 (2024-03-18)
* Change minimum SDK version to 21
* Update [PdfiumAndroid library](https://github.com/lion1988dev/PdfiumAndroid) to 1.9.3

## 3.2.1 (2024-03-10)
* Change minimum SDK version to 19
* Drop MIPS support
* Update to Androidx
* Switch pdfium-android to a [fork](https://github.com/lion1988dev/PdfiumAndroid) so we can disable jetifier

## 3.2.0-beta.1 (2019-08-18)
* Merge PR #714 with optimized page load
* Merge PR #776 with fix for max & min zoom level
Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

# Looking for new maintainer!
#### This is a fork of the [AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer)
switch back to the mainline repo when it gets migrated off JCenter


# Android PdfViewer
Expand All @@ -12,6 +13,20 @@ Library for displaying PDF documents on Android, with `animations`, `gestures`,
It is based on [PdfiumAndroid](https://github.com/barteksc/PdfiumAndroid) for decoding PDF files. Works on API 11 (Android 3.0) and higher.
Licensed under Apache License 2.0.

## 3.2.4
* Update [PdfiumAndroid library](https://github.com/lion1988dev/PdfiumAndroid) to 1.9.4


## 3.2.3
* Change minimum SDK version to 21
* Update [PdfiumAndroid library](https://github.com/lion1988dev/PdfiumAndroid) to 1.9.3

## 3.2.1
* Change minimum SDK version to 23
* Drop MIPS support
* Update to Androidx
* Switch pdfium-android to a [fork](https://github.com/lion1988dev/PdfiumAndroid) so we can disable jetifier

## What's new in 3.2.0-beta.1?
* Merge PR #714 with optimized page load
* Merge PR #776 with fix for max & min zoom level
Expand All @@ -35,15 +50,19 @@ Licensed under Apache License 2.0.

## Installation

Add to _build.gradle_:

`implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'`

or if you want to use more stable version:

`implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'`
Add to the root _build.gradle_:
```groovy
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```
Add to the app _build.gradle_:

Library is available in jcenter repository, probably it'll be in Maven Central soon.
`implementation 'com.github.lion1988dev:AndroidPdfViewer:3.2.3'`

## ProGuard
If you are using ProGuard, add following rule to proguard config file:
Expand Down
89 changes: 0 additions & 89 deletions android-pdf-viewer/bintray.gradle

This file was deleted.

76 changes: 46 additions & 30 deletions android-pdf-viewer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
apply plugin: 'com.android.library'

ext {
bintrayRepo = 'maven'
bintrayName = 'android-pdf-viewer'

publishedGroupId = 'com.github.barteksc'
libraryName = 'AndroidPdfViewer'
artifact = 'android-pdf-viewer'
plugins {
id 'com.android.library'
id 'maven-publish'
}

libraryDescription = 'Android view for displaying PDFs rendered with PdfiumAndroid'
group "com.github.lion1988dev"

siteUrl = 'https://github.com/barteksc/AndroidPdfViewer'
gitUrl = 'https://github.com/barteksc/AndroidPdfViewer.git'
android {
namespace "com.github.barteksc.pdfviewer"

libraryVersion = '3.2.0-beta.1'
compileSdk rootProject.tools.compileSdk

developerId = 'barteksc'
developerName = 'Bartosz Schiller'
developerEmail = '[email protected]'
defaultConfig {
minSdk rootProject.tools.minSdk
targetSdk rootProject.tools.targetSdk

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
versionCode rootProject.tools.versionCode
versionName "${rootProject.tools.versionName}"
}

android {
compileSdkVersion 28
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "3.2.0-beta.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

publishing {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
}

dependencies {
implementation 'com.android.support:support-compat:28.0.0'
api 'com.github.barteksc:pdfium-android:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
api 'com.github.lion1988dev:PdfiumAndroid:1.9.4'
}

apply from: 'bintray.gradle'
publishing {
publications {
release(MavenPublication) {
groupId = 'com.github.lion1988dev'
artifactId = 'AndroidPdfViewer'
version = "3.2.4"

afterEvaluate {
from components.release
}
}
}
}
Empty file.
22 changes: 22 additions & 0 deletions android-pdf-viewer/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.shockwave.**
3 changes: 1 addition & 2 deletions android-pdf-viewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.barteksc.pdfviewer">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.github.barteksc.pdfviewer;

import android.graphics.RectF;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.github.barteksc.pdfviewer.model.PagePart;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.support.v4.content.ContextCompat;
import androidx.core.content.ContextCompat;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.ViewGroup;
Expand Down
27 changes: 11 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
plugins {
id 'com.android.application' version '8.3.0' apply false
id 'com.android.library' version '8.3.0' apply false
}

allprojects {
repositories {
google()
jcenter()
}
ext {
tools = [
minSdk : 21,
targetSdk : 34,
compileSdk : 34,
versionCode: 3,
versionName: '3.2.4'
]
}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
android.enableJetifier=false
android.useAndroidX=true
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Aug 18 01:14:14 CEST 2019
#Sun Mar 10 12:47:57 EET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Loading