diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index d84fb97..a2d6f5e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,6 +16,7 @@ diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index eb2873e..936e1c8 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -26,5 +26,10 @@ - + diff --git a/app/build.gradle b/app/build.gradle index caa056b..a35c13c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,9 +16,9 @@ android { defaultConfig { applicationId "com.android.NBZxing" minSdkVersion 17 - targetSdkVersion 29 - versionCode 15 - versionName "1.15" + targetSdkVersion 27 + versionCode 17 + versionName "1.21" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" signingConfig signingConfigs.release compileOptions { @@ -46,6 +46,7 @@ dependencies { api "androidx.appcompat:appcompat:1.1.0" implementation 'com.zhihu.android:matisse:0.5.3-beta3' api "com.github.bumptech.glide:glide:4.11.0" + api 'com.tencent.bugly:crashreport:3.2.3' // // implementation 'com.github.ailiwean:NBZxing-Scale:0.0.3' // implementation 'com.github.ailiwean:NBZxing:0.0.25' diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 57fb851..1ee2372 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1 +1,3 @@ --keep public class com.ailiwean.module_grayscale.GrayScaleDispatch \ No newline at end of file +-keep public class com.ailiwean.module_grayscale.GrayScaleDispatch +-dontwarn com.tencent.bugly.** +-keep public class com.tencent.bugly.**{*;} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 87dcffb..ec54547 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,22 +5,36 @@ + + + + + + + + + - + + diff --git a/app/src/main/java/com/android/NBZxing/App.java b/app/src/main/java/com/android/NBZxing/App.java new file mode 100644 index 0000000..428725e --- /dev/null +++ b/app/src/main/java/com/android/NBZxing/App.java @@ -0,0 +1,22 @@ +package com.android.NBZxing; + +import android.app.Application; + +import com.tencent.bugly.crashreport.CrashReport; + + +/** + * @Package: com.android.NBZxing + * @ClassName: App + * @Description: + * @Author: SWY + * @CreateDate: 2020/10/1 9:22 PM + */ +public class App extends Application { + + @Override + public void onCreate() { + super.onCreate(); + CrashReport.initCrashReport(getApplicationContext(), "99de934384", true); + } +} diff --git a/app/src/main/java/com/android/NBZxing/CusScanView.kt b/app/src/main/java/com/android/NBZxing/CusScanView.kt index e3615a1..08ec9b0 100644 --- a/app/src/main/java/com/android/NBZxing/CusScanView.kt +++ b/app/src/main/java/com/android/NBZxing/CusScanView.kt @@ -17,10 +17,6 @@ import com.google.android.cameraview.AspectRatio */ class CusScanView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, def: Int = 0) : NBZxingView(context, attributeSet, def) { - init { - setAspectRatio(AspectRatio.of(16, 9)) - } - override fun resultBack(content: String) { Toast.makeText(context, content, Toast.LENGTH_SHORT).show() } diff --git a/app/src/main/java/com/android/NBZxing/MainActiviy.kt b/app/src/main/java/com/android/NBZxing/MainActiviy.kt new file mode 100644 index 0000000..f7f06a5 --- /dev/null +++ b/app/src/main/java/com/android/NBZxing/MainActiviy.kt @@ -0,0 +1,25 @@ +package com.android.NBZxing + +import android.os.Bundle +import android.view.View +import androidx.appcompat.app.AppCompatActivity + +/** + * @Package: com.android.NBZxing + * @ClassName: MainActiviy + * @Description: + * @Author: SWY + * @CreateDate: 2020/10/18 7:26 PM + */ +class MainActiviy : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_select) + } + + fun toClick(view: View) { + ScanActivity.startSelf(this) + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/android/NBZxing/MainActivity.kt b/app/src/main/java/com/android/NBZxing/ScanActivity.kt similarity index 81% rename from app/src/main/java/com/android/NBZxing/MainActivity.kt rename to app/src/main/java/com/android/NBZxing/ScanActivity.kt index 559cb40..5bc9bd1 100644 --- a/app/src/main/java/com/android/NBZxing/MainActivity.kt +++ b/app/src/main/java/com/android/NBZxing/ScanActivity.kt @@ -2,6 +2,7 @@ package com.android.NBZxing import android.Manifest import android.app.Activity +import android.content.Context import android.content.Intent import android.content.pm.ActivityInfo import android.content.pm.PackageManager @@ -9,15 +10,25 @@ import android.graphics.Color import android.os.Build import android.os.Bundle import android.view.View +import android.view.Window +import android.view.WindowManager import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import com.zhihu.matisse.Matisse import com.zhihu.matisse.MimeType import com.zhihu.matisse.engine.impl.GlideEngine -class MainActivity : AppCompatActivity() { +class ScanActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + +// requestWindowFeature(Window.FEATURE_NO_TITLE) +// window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, +// WindowManager.LayoutParams.FLAG_FULLSCREEN); +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { +// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, +// WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) +// } setContentView(R.layout.activity_main) findViewById(R.id.zxingview) .synchLifeStart(this) @@ -28,10 +39,13 @@ class MainActivity : AppCompatActivity() { // .commit(); } - fun initView() { + companion object { + fun startSelf(context: Context) { + context.startActivity(Intent(context, ScanActivity::class.java)) + } + } - findViewById(R.id.vToolBar) - .setBackgroundColor(Color.parseColor("#2f000000")) + fun initView() { findViewById(R.id.vTitle).text = "扫一扫" diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 369b4f9..f55c41e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -12,5 +12,4 @@ - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_select.xml b/app/src/main/res/layout/activity_select.xml new file mode 100644 index 0000000..de234d3 --- /dev/null +++ b/app/src/main/res/layout/activity_select.xml @@ -0,0 +1,17 @@ + + + + +