Skip to content

Commit 7b083da

Browse files
committed
Update Gradle & Kotlin & PlatformSDK
- Update Kotlin version to 1.7.0 - Update Gradle dependencies - Merge legacy code
1 parent 6b18128 commit 7b083da

7 files changed

Lines changed: 19 additions & 17 deletions

File tree

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins {
22
id 'com.android.application'
33
id 'kotlin-android'
4-
id 'com.google.devtools.ksp' version '1.6.21-1.0.5'
4+
id 'com.google.devtools.ksp' version '1.7.0-1.0.6'
55
}
66

77
android {
8-
compileSdk 31
8+
compileSdk 32
99

1010
signingConfigs {
1111
debug {
@@ -21,7 +21,7 @@ android {
2121
defaultConfig {
2222
applicationId "com.fankes.miui.notify"
2323
minSdk 28
24-
targetSdk 31
24+
targetSdk 32
2525
versionCode rootProject.ext.appVersionCode
2626
versionName rootProject.ext.appVersionName
2727

@@ -63,10 +63,10 @@ dependencies {
6363
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.92'
6464
implementation "com.github.topjohnwu.libsu:core:3.1.2"
6565
implementation 'androidx.annotation:annotation:1.3.0'
66-
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
67-
implementation 'androidx.core:core-ktx:1.7.0'
68-
implementation 'androidx.appcompat:appcompat:1.4.1'
69-
implementation 'com.google.android.material:material:1.6.0'
66+
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.7'
67+
implementation 'androidx.core:core-ktx:1.8.0'
68+
implementation 'androidx.appcompat:appcompat:1.4.2'
69+
implementation 'com.google.android.material:material:1.6.1'
7070
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
7171
testImplementation 'junit:junit:4.13.2'
7272
androidTestImplementation 'androidx.test.ext:junit:1.1.3'

app/src/main/java/com/fankes/miui/notify/ui/activity/base/BaseActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package com.fankes.miui.notify.ui.activity.base
2727
import android.os.Bundle
2828
import androidx.appcompat.app.AppCompatActivity
2929
import androidx.core.content.res.ResourcesCompat
30-
import androidx.core.view.ViewCompat
30+
import androidx.core.view.WindowCompat
3131
import androidx.viewbinding.ViewBinding
3232
import com.fankes.miui.notify.R
3333
import com.fankes.miui.notify.utils.factory.isNotSystemInDarkMode
@@ -61,7 +61,7 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
6161
/** 隐藏系统的标题栏 */
6262
supportActionBar?.hide()
6363
/** 初始化沉浸状态栏 */
64-
ViewCompat.getWindowInsetsController(window.decorView)?.apply {
64+
WindowCompat.getInsetsController(window, window.decorView).apply {
6565
isAppearanceLightStatusBars = isNotSystemInDarkMode
6666
isAppearanceLightNavigationBars = isNotSystemInDarkMode
6767
}

app/src/main/java/com/fankes/miui/notify/utils/drawable/drawabletoolbox/FlipDrawable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* This file is Created by fankes on 2022/1/8.
2222
*/
23-
@file:Suppress("DEPRECATION", "CanvasSize")
23+
@file:Suppress("DEPRECATION", "CanvasSize", "OVERRIDE_DEPRECATION")
2424

2525
package com.fankes.miui.notify.utils.drawable.drawabletoolbox
2626

app/src/main/java/com/fankes/miui/notify/utils/tool/GithubReleaseTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ object GithubReleaseTool {
6161
override fun onFailure(call: Call, e: IOException) {}
6262

6363
override fun onResponse(call: Call, response: Response) = runInSafe {
64-
JSONObject(response.body?.string() ?: "").apply {
64+
JSONObject(response.body.string()).apply {
6565
GithubReleaseBean(
6666
name = getString("name"),
6767
htmlUrl = getString("html_url"),

app/src/main/java/com/fankes/miui/notify/utils/tool/IconRuleManagerTool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ object IconRuleManagerTool {
343343
}
344344

345345
override fun onResponse(call: Call, response: Response) {
346-
val bodyString = response.body?.string() ?: ""
346+
val bodyString = response.body.string()
347347
(context as? Activity?)?.runOnUiThread { result(true, bodyString) } ?: result(true, bodyString)
348348
}
349349
})

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id 'com.android.application' version '7.2.0' apply false
3-
id 'com.android.library' version '7.2.0' apply false
4-
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
2+
id 'com.android.application' version '7.2.1' apply false
3+
id 'com.android.library' version '7.2.1' apply false
4+
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
55
}
66

77
ext {

gradle.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
9+
org.gradle.jvmargs=-XX:+UseParallelGC
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -18,4 +18,6 @@ android.useAndroidX=true
1818
# Automatically convert third-party libraries to use AndroidX
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
21-
kotlin.code.style=official
21+
kotlin.code.style=official
22+
# Incremental
23+
kotlin.incremental.useClasspathSnapshot=true

0 commit comments

Comments
 (0)