From e49b5b2bf41c2c1ff024bd04e94304aec8b250d6 Mon Sep 17 00:00:00 2001 From: jia Date: Tue, 27 Aug 2024 20:05:41 +0800 Subject: [PATCH] feat --- build.gradle | 4 + iFish7/build.gradle | 6 + iFish7/src/main/AndroidManifest.xml | 15 ++ .../ifish/activity/BindTwoDeviceActivity.java | 113 +++++++++++++- .../com/ifish/activity/BluetoothActivity.java | 107 +++++++++++++ .../ifish/activity/newbind/AirKissUtil.java | 146 +++++++++--------- .../newbind/NewBindDeviceActivity.java | 10 +- .../ifish/adapter/BlueToothController.java | 52 +++++++ .../java/com/ifish/utils/BlueToothUtil.kt | 27 ++++ .../main/res/layout/activity_bluetooth.xml | 24 +++ .../res/layout/bindtwodevice_activity.xml | 12 ++ 11 files changed, 443 insertions(+), 73 deletions(-) create mode 100644 iFish7/src/main/java/com/ifish/activity/BluetoothActivity.java create mode 100644 iFish7/src/main/java/com/ifish/adapter/BlueToothController.java create mode 100644 iFish7/src/main/java/com/ifish/utils/BlueToothUtil.kt create mode 100644 iFish7/src/main/res/layout/activity_bluetooth.xml diff --git a/build.gradle b/build.gradle index 64652207a..e001e0d6a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,8 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext { + kotlin_version = '1.9.22' + } repositories { //添加阿里云镜像 maven { url 'https://maven.aliyun.com/repository/public' } @@ -13,6 +16,7 @@ buildscript { dependencies { // classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2' classpath 'com.android.tools.build:gradle:7.4.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { diff --git a/iFish7/build.gradle b/iFish7/build.gradle index 3e93365f8..c1e70262b 100644 --- a/iFish7/build.gradle +++ b/iFish7/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'org.jetbrains.kotlin.android' gradle.ext { pushVersion = '3.8.6' thirdPushVersion = '3.8.6' @@ -64,6 +65,9 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + kotlinOptions { + jvmTarget = '1.8' + } } repositories { @@ -100,6 +104,8 @@ dependencies { implementation 'com.google.android.material:material:1.0.0' // implementation 'com.github.bumptech.glide:glide:3.7.0' implementation 'com.github.bumptech.glide:glide:4.11.0' + implementation 'androidx.core:core-ktx:1.10.1' +// implementation 'androidx.activity:activity:1.8.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' //Glide diff --git a/iFish7/src/main/AndroidManifest.xml b/iFish7/src/main/AndroidManifest.xml index 78a7db8df..aa1aa03d5 100644 --- a/iFish7/src/main/AndroidManifest.xml +++ b/iFish7/src/main/AndroidManifest.xml @@ -81,6 +81,16 @@ + + + + + + + + + +