From d243b39377f19c3eae41e227067da254ebbf731b Mon Sep 17 00:00:00 2001 From: Bartosz Schiller Date: Sun, 18 Aug 2019 03:29:22 +0200 Subject: [PATCH] Update version Replace bintray upload scripts with fixed one Update README and CHANGELOG Fix max zoom detection --- CHANGELOG.md | 14 +++ README.md | 32 +++---- android-pdf-viewer/bintray.gradle | 89 +++++++++++++++++++ android-pdf-viewer/build.gradle | 13 ++- .../barteksc/pdfviewer/DragPinchManager.java | 2 +- build.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- sample/build.gradle | 10 +-- 8 files changed, 135 insertions(+), 33 deletions(-) create mode 100644 android-pdf-viewer/bintray.gradle diff --git a/CHANGELOG.md b/CHANGELOG.md index dbee53f8..7652d133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 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 +* Merge PR #722 with fix for showing right position when view size changed +* Merge PR #703 with fix for too many threads +* Merge PR #702 with fix for memory leak +* Merge PR #689 with possibility to disable long click +* Merge PR #628 with fix for hiding scroll handle +* Merge PR #627 with `fitEachPage` option +* Merge PR #638 and #406 with fixed NPE +* Merge PR #780 with README fix +* Update compile SDK and support library to 28 +* Update Gradle and Gradle Plugin + ## 3.1.0-beta.1 (2018-06-29) * Merge pull request #557 for snapping pages (scrolling page by page) * merge pull request #618 for night mode diff --git a/README.md b/README.md index b365ce77..72fe8678 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ +# Looking for new maintainer! -# Android PdfViewer - - -__这个分支,在原3.1.0-beta1的基础上,优化了渲染区域的计算方式,减少不必要的渲染区域。__ - -3.1.0-beta1在计算渲染方式上有个bug,在跨页的时候会渲染上一页的最后一行,不管这一行是不是全部显示在屏幕中。当放大的倍数越大, -需要渲染的块就多,由于最大数量的限制,会导致部分在屏幕下方的区域不会被渲染。 +# Android PdfViewer __AndroidPdfViewer 1.x is available on [AndroidPdfViewerV1](https://github.com/barteksc/AndroidPdfViewerV1) repo, where can be developed independently. Version 1.x uses different engine for drawing document on canvas, @@ -17,14 +12,19 @@ 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. -## What's new in 3.1.0-beta.1? -* Merge pull request #557 for snapping pages (scrolling page by page) -* merge pull request #618 for night mode -* Merge pull request #566 for `OnLongTapListener` -* Update PdfiumAndroid to 1.9.0, which uses `c++_shared` instead of `gnustl_static` -* Update Gradle Plugin -* Update compile SDK and support library to 26 -* Change minimum SDK to 14 +## 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 +* Merge PR #722 with fix for showing right position when view size changed +* Merge PR #703 with fix for too many threads +* Merge PR #702 with fix for memory leak +* Merge PR #689 with possibility to disable long click +* Merge PR #628 with fix for hiding scroll handle +* Merge PR #627 with `fitEachPage` option +* Merge PR #638 and #406 with fixed NPE +* Merge PR #780 with README fix +* Update compile SDK and support library to 28 +* Update Gradle and Gradle Plugin ## Changes in 3.0 API * Replaced `Contants.PRELOAD_COUNT` with `PRELOAD_OFFSET` @@ -37,7 +37,7 @@ Licensed under Apache License 2.0. Add to _build.gradle_: -`implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1'` +`implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'` or if you want to use more stable version: diff --git a/android-pdf-viewer/bintray.gradle b/android-pdf-viewer/bintray.gradle new file mode 100644 index 00000000..9a01f197 --- /dev/null +++ b/android-pdf-viewer/bintray.gradle @@ -0,0 +1,89 @@ +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' + +group = publishedGroupId +version = libraryVersion + +install { + repositories.mavenInstaller { + pom.project { + packaging 'aar' + groupId publishedGroupId + artifactId artifact + + name libraryName + description libraryDescription + url siteUrl + + licenses { + license { + name licenseName + url licenseUrl + } + } + developers { + developer { + id developerId + name developerName + email developerEmail + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } + } + } +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +afterEvaluate { + javadoc.classpath += files(android.libraryVariants.collect { variant -> + variant.javaCompileProvider.get().classpath.files + }) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives javadocJar + archives sourcesJar +} + +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + + configurations = ['archives'] + pkg { + repo = bintrayRepo + name = bintrayName + desc = libraryDescription + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = allLicenses + dryRun = false + publish = true + override = false + publicDownloadNumbers = true + version { + desc = libraryDescription + } + } +} \ No newline at end of file diff --git a/android-pdf-viewer/build.gradle b/android-pdf-viewer/build.gradle index 784ac639..32d03665 100644 --- a/android-pdf-viewer/build.gradle +++ b/android-pdf-viewer/build.gradle @@ -13,7 +13,7 @@ ext { siteUrl = 'https://github.com/barteksc/AndroidPdfViewer' gitUrl = 'https://github.com/barteksc/AndroidPdfViewer.git' - libraryVersion = '3.1.0-beta.1' + libraryVersion = '3.2.0-beta.1' developerId = 'barteksc' developerName = 'Bartosz Schiller' @@ -25,21 +25,20 @@ ext { } android { - compileSdkVersion 26 + compileSdkVersion 28 defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 28 versionCode 1 - versionName "3.1.0-beta.1" + versionName "3.2.0-beta.1" } } dependencies { - implementation 'com.android.support:support-compat:26.1.0' + implementation 'com.android.support:support-compat:28.0.0' api 'com.github.barteksc:pdfium-android:1.9.0' } -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' \ No newline at end of file +apply from: 'bintray.gradle' \ No newline at end of file diff --git a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java index c87e6648..3860bc73 100644 --- a/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java +++ b/android-pdf-viewer/src/main/java/com/github/barteksc/pdfviewer/DragPinchManager.java @@ -261,7 +261,7 @@ public boolean onScale(ScaleGestureDetector detector) { float dr = detector.getScaleFactor(); float wantedZoom = pdfView.getZoom() * dr; float minZoom = Math.min(MINIMUM_ZOOM, pdfView.getMinZoom()); - float maxZoom = Math.max(MAXIMUM_ZOOM, pdfView.getMaxZoom()); + float maxZoom = Math.min(MAXIMUM_ZOOM, pdfView.getMaxZoom()); if (wantedZoom < minZoom) { dr = minZoom / pdfView.getZoom(); } else if (wantedZoom > maxZoom) { diff --git a/build.gradle b/build.gradle index a40f1b28..0a9a0ba0 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1' + 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' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8fc5b9c1..1a59b22b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jun 27 20:37:56 CEST 2018 +#Sun Aug 18 01:14:14 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/sample/build.gradle b/sample/build.gradle index 5b0fb37e..133bcdde 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -13,11 +13,11 @@ repositories { apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 28 defaultConfig { minSdkVersion 14 - targetSdkVersion 26 + targetSdkVersion 28 versionCode 3 versionName "3.0.0" } @@ -26,7 +26,7 @@ android { dependencies { implementation project(':android-pdf-viewer') - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'org.androidannotations:androidannotations-api:4.4.0' - annotationProcessor "org.androidannotations:androidannotations:4.4.0" + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'org.androidannotations:androidannotations-api:4.6.0' + annotationProcessor "org.androidannotations:androidannotations:4.6.0" }