From 23a3bf1a9c52a54fb614c6751bef3a39152a7347 Mon Sep 17 00:00:00 2001 From: Ivan Murashov Date: Sun, 20 May 2018 12:56:01 +0300 Subject: [PATCH] Android camera fixes, purchase screen fixes --- android/app/build.gradle | 38 +- android/app/src/main/AndroidManifest.xml | 14 +- .../java/com/dinect/checker/MainActivity.java | 172 +++----- .../com/dinect/checker/ScannerActivity.java | 383 ++++++++++++++++++ android/app/src/main/res/layout/a_zxing.xml | 34 +- .../src/main/res/layout/v_custom_toolbar.xml | 55 +-- android/build.gradle | 35 +- assets/values-en/strings.xml | 9 + assets/values-es/strings.xml | 9 + assets/values-ru/strings.xml | 9 + assets/values-ua/strings.xml | 9 + ios/Podfile | 10 +- ios/Podfile.lock | 21 +- ios/Runner.xcodeproj/project.pbxproj | 122 +++--- lib/common.dart | 2 - lib/network.dart | 3 +- pubspec.lock | 17 +- pubspec.yaml | 2 +- 18 files changed, 659 insertions(+), 285 deletions(-) create mode 100644 android/app/src/main/java/com/dinect/checker/ScannerActivity.java diff --git a/android/app/build.gradle b/android/app/build.gradle index 1ebcf72..f638b05 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -12,6 +12,7 @@ if (flutterRoot == null) { } apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { @@ -24,7 +25,7 @@ android { defaultConfig { targetSdkVersion 27 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + minSdkVersion 16 applicationId "com.dinect.checker" } @@ -35,13 +36,13 @@ android { } release { signingConfig signingConfigs.debug + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } flavorDimensions "checker" - // Не смог разобраться, как коомбинировать flavors в flutter при запуске - productFlavors { dinect { @@ -174,16 +175,9 @@ android { buildConfigField "boolean", "showBonus", "true" } } - - sourceSets { - - main.jniLibs.srcDir 'jniLibs' - - pip { - res.srcDirs = ['src/pip/res'] - manifest.srcFile 'src/pip/AndroidManifest.xml' - } - + compileOptions { + targetCompatibility 1.8 + sourceCompatibility 1.8 } } @@ -192,9 +186,17 @@ flutter { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.android.support:appcompat-v7:27.1.0' - compile 'com.squareup.okhttp3:okhttp:3.8.1' - compile 'com.squareup.okio:okio:1.13.0' - compile 'me.dm7.barcodescanner:zxing:1.9.8' + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:recyclerview-v7:27.1.1' + implementation 'com.android.support:support-v4:27.1.1' + implementation 'com.android.support:support-media-compat:27.1.1' + implementation 'com.squareup.okhttp3:okhttp:3.9.0' + implementation 'com.squareup.okio:okio:1.13.0' + implementation 'me.dm7.barcodescanner:zxing:1.9.8' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} + +repositories { + mavenCentral() } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6b1e77d..0f491a0 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -4,10 +4,6 @@ android:versionCode="13" android:versionName="1.1.18"> - -