From 99718f6af286db353a291c9bb0af423384938756 Mon Sep 17 00:00:00 2001 From: weilu Date: Thu, 15 Aug 2019 16:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 7 +++---- .../apptreesoftware/barcodescan/BarcodeScannerActivity.kt | 8 ++++---- example/android/app/build.gradle | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 1ac4e7c..4667ae2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41" } } @@ -42,8 +42,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.20' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.41' implementation 'me.dm7.barcodescanner:zxing:1.9.13' - api 'com.google.android.material:material:1.0.0' } diff --git a/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt b/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt index 340e7db..e33255a 100644 --- a/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt +++ b/android/src/main/kotlin/com/apptreesoftware/barcodescan/BarcodeScannerActivity.kt @@ -5,10 +5,10 @@ import android.app.Activity import android.content.Intent import android.content.pm.PackageManager import android.os.Bundle -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat import android.view.Menu import android.view.MenuItem +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat import com.google.zxing.Result import me.dm7.barcodescanner.zxing.ZXingScannerView @@ -36,11 +36,11 @@ class BarcodeScannerActivity : Activity(), ZXingScannerView.ResultHandler { override fun onCreateOptionsMenu(menu: Menu): Boolean { if (scannerView.flash) { val item = menu.add(0, - TOGGLE_FLASH, 0, "Flash Off") + TOGGLE_FLASH, 0, "关闭闪光灯") item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS) } else { val item = menu.add(0, - TOGGLE_FLASH, 0, "Flash On") + TOGGLE_FLASH, 0, "开启闪光灯") item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS) } return super.onCreateOptionsMenu(menu) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 614df20..30d4008 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -17,7 +17,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 28 - buildToolsVersion "27.0.3" + buildToolsVersion "28.0.3" sourceSets { main.java.srcDirs += 'src/main/kotlin'