diff --git a/android/build.gradle b/android/build.gradle index e268524..7ef5163 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.pycampers.flutterpdfviewer' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.31' + ext.kotlin_version = '1.3.72' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:3.6.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,13 +25,13 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 19 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { @@ -41,9 +41,9 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1' - implementation 'com.google.android.exoplayer:exoplayer:2.9.3' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' + implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1' + implementation 'com.google.android.exoplayer:exoplayer:2.11.4' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' + implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-alpha01' implementation project(path: ':plugin_scaffold') } diff --git a/android/src/main/kotlin/com/pycampers/flutterpdfviewer/FlutterPdfViewerPlugin.kt b/android/src/main/kotlin/com/pycampers/flutterpdfviewer/FlutterPdfViewerPlugin.kt index 827aa41..080bcd4 100644 --- a/android/src/main/kotlin/com/pycampers/flutterpdfviewer/FlutterPdfViewerPlugin.kt +++ b/android/src/main/kotlin/com/pycampers/flutterpdfviewer/FlutterPdfViewerPlugin.kt @@ -9,7 +9,6 @@ import android.os.Bundle import androidx.localbroadcastmanager.content.LocalBroadcastManager import com.pycampers.plugin_scaffold.createPluginScaffold import com.pycampers.plugin_scaffold.trySend -import com.pycampers.plugin_scaffold.trySendError import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel.Result import io.flutter.plugin.common.PluginRegistry.Registrar @@ -164,16 +163,7 @@ class FlutterPdfViewerMethods(val registrar: Registrar) { object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val args = intent.extras!! - if (args.containsKey("error")) { - trySendError( - result, - args.getString("error"), - args.getString("message"), - args.getString("stacktrace") - ) - } else { - trySend(result) - } + trySend(result) broadcaster.unregisterReceiver(this) } }, @@ -182,4 +172,4 @@ class FlutterPdfViewerMethods(val registrar: Registrar) { registrar.activity().startActivity(intent) } -} \ No newline at end of file +} diff --git a/android/src/main/kotlin/com/pycampers/flutterpdfviewer/PdfActivityThread.kt b/android/src/main/kotlin/com/pycampers/flutterpdfviewer/PdfActivityThread.kt index 44b5fc7..9062973 100644 --- a/android/src/main/kotlin/com/pycampers/flutterpdfviewer/PdfActivityThread.kt +++ b/android/src/main/kotlin/com/pycampers/flutterpdfviewer/PdfActivityThread.kt @@ -78,10 +78,8 @@ class PdfActivityThread( .onTap(playerController) .defaultPage(initialPage) - if (opts.containsKey("pages")) { - configurator = configurator.pages(*opts.getIntArray("pages")) - } + configurator.load() } -} \ No newline at end of file +} diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 98b33ae..2287517 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 29 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -38,8 +38,8 @@ android { defaultConfig { applicationId "com.pycampers.flutterpdfviewerexample" - minSdkVersion 19 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 29 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -65,7 +65,7 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + testImplementation 'junit:junit:4.13' + androidTestImplementation 'androidx.test:runner:1.3.0-beta01' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-beta01' } diff --git a/example/android/build.gradle b/example/android/build.gradle index cd02952..45d37ba 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.31' + ext.kotlin_version = '1.3.72' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0-beta05' + classpath 'com.android.tools.build:gradle:3.6.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index f79468e..096f543 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 54a16ec..08e7db8 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -9,7 +9,7 @@ dependencies: flutter: sdk: flutter - path_provider: ^0.5.0+1 + path_provider: dev_dependencies: flutter_test: diff --git a/pubspec.yaml b/pubspec.yaml index 83fde5a..c59ba98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,18 +1,18 @@ name: flutter_pdf_viewer description: A native Pdf viewer for flutter based on Pdfium Android -version: 0.6.1 +version: 0.6.2 author: Dev Aggarwal homepage: https://github.com/pycampers/flutter_pdf_viewer environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: ">=2.1.0 <3.0.0" dependencies: flutter: sdk: flutter - crypto: ^2.0.6 - plugin_scaffold: ^1.1.1 + crypto: + plugin_scaffold: # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec