From 94c46b477a41f828cddb78e8d291663747668a18 Mon Sep 17 00:00:00 2001 From: lucka-me Date: Wed, 20 Mar 2024 21:27:23 +0800 Subject: [PATCH 1/3] Bump target SDK to 34 --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0031294..ec3828d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,12 +4,12 @@ plugins { } android { - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "labs.lucka.refrain" minSdk 28 - targetSdk 33 + targetSdk 34 versionCode 7 versionName "1.5.0" vectorDrawables { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5f784c1..4c0c96d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Refrain" - tools:targetApi="33"> + tools:targetApi="34"> From 62d28090718b0cf60e8904014627e2970a09b024 Mon Sep 17 00:00:00 2001 From: lucka-me Date: Wed, 20 Mar 2024 21:27:58 +0800 Subject: [PATCH 2/3] Upgrade dependencies, gradle and fix warnings --- app/build.gradle | 25 ++++++++++--------- .../labs/lucka/refrain/ui/RefrainModel.kt | 3 ++- .../ui/content/main/OutputFormatCard.kt | 4 +-- build.gradle | 7 +++--- gradle.properties | 1 - gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ec3828d..74479e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,6 +34,7 @@ android { } buildFeatures { compose true + buildConfig true } composeOptions { kotlinCompilerExtensionVersion '1.4.0' @@ -47,19 +48,19 @@ android { } dependencies { - implementation 'androidx.activity:activity-compose:1.7.2' + implementation 'androidx.activity:activity-compose:1.8.2' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation "androidx.compose.material:material-icons-extended:1.4.3" - implementation 'androidx.compose.material3:material3:1.1.0' - implementation "androidx.compose.ui:ui:1.4.3" - implementation "androidx.compose.ui:ui-tooling-preview:1.4.3" - implementation 'androidx.core:core-ktx:1.10.1' + implementation "androidx.compose.material:material-icons-extended:1.6.2" + implementation 'androidx.compose.material3:material3:1.2.0' + implementation "androidx.compose.ui:ui:1.6.2" + implementation "androidx.compose.ui:ui-tooling-preview:1.6.2" + implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.datastore:datastore-preferences:1.0.0' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' - implementation "com.google.accompanist:accompanist-permissions:$accompanist_version" - implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version" - implementation 'com.google.android.material:material:1.9.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' + implementation 'com.google.accompanist:accompanist-permissions:0.34.0' + implementation 'com.google.accompanist:accompanist-systemuicontroller:0.34.0' + implementation 'com.google.android.material:material:1.11.0' - debugImplementation "androidx.compose.ui:ui-tooling:1.4.3" - debugImplementation "androidx.compose.ui:ui-test-manifest:1.4.3" + debugImplementation "androidx.compose.ui:ui-tooling:1.6.2" + debugImplementation "androidx.compose.ui:ui-test-manifest:1.6.2" } \ No newline at end of file diff --git a/app/src/main/java/labs/lucka/refrain/ui/RefrainModel.kt b/app/src/main/java/labs/lucka/refrain/ui/RefrainModel.kt index bdb790f..30ce0e1 100644 --- a/app/src/main/java/labs/lucka/refrain/ui/RefrainModel.kt +++ b/app/src/main/java/labs/lucka/refrain/ui/RefrainModel.kt @@ -59,7 +59,8 @@ class RefrainModel : ViewModel() { } fun onResume(context: Context) { - serviceIntent = Intent(context, TraceService::class.java) + val serviceIntent = Intent(context, TraceService::class.java) + this.serviceIntent = serviceIntent context.startForegroundService(serviceIntent) serviceBound = context.bindService( serviceIntent, serviceConnection, Service.BIND_AUTO_CREATE diff --git a/app/src/main/java/labs/lucka/refrain/ui/content/main/OutputFormatCard.kt b/app/src/main/java/labs/lucka/refrain/ui/content/main/OutputFormatCard.kt index c01ab00..1aa5f6e 100644 --- a/app/src/main/java/labs/lucka/refrain/ui/content/main/OutputFormatCard.kt +++ b/app/src/main/java/labs/lucka/refrain/ui/content/main/OutputFormatCard.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.selection.selectable import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.InsertDriveFile +import androidx.compose.material.icons.automirrored.filled.InsertDriveFile import androidx.compose.material3.Checkbox import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -30,7 +30,7 @@ fun OutputFormatCard(mutable: Boolean) { ExpandableCard( stringResource(R.string.output_format), - Icons.Filled.InsertDriveFile, + Icons.AutoMirrored.Filled.InsertDriveFile, stringResource(R.string.output_format_alt) ) { FormatField(R.string.output_format_csv, enableCSV, mutable) { enableCSV = !enableCSV } diff --git a/build.gradle b/build.gradle index 19b5822..867981c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,13 @@ buildscript { ext { - accompanist_version = '0.25.1' } }// Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.0.2' apply false - id 'com.android.library' version '8.0.2' apply false + id 'com.android.application' version '8.3.1' apply false + id 'com.android.library' version '8.3.1' apply false id 'org.jetbrains.kotlin.android' version '1.8.0' apply false } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7d91cfd..880448b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,5 +22,4 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true org.gradle.unsafe.configuration-cache=tue -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8ce3700..92da656 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Jan 20 23:37:28 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 5fcf747c5554a6e91d4406e4e0c477f770cf1ccd Mon Sep 17 00:00:00 2001 From: lucka-me Date: Wed, 20 Mar 2024 21:30:03 +0800 Subject: [PATCH 3/3] Update README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2827a5..69545ce 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ![](app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png) -[![Lines of code](https://img.shields.io/tokei/lines/github/lucka-me/refrain)](# "Repository") -[![Target API](https://img.shields.io/badge/target_api-33-78C257.svg)](https://developer.android.com/about/versions/13 "Android 13") -[![Min API](https://img.shields.io/badge/min_api-28-78C257.svg)](https://developer.android.com/about/versions/pie "Android 9 Pie") +[![Lines of code](https://aschey.tech/tokei/github/lucka-me/refrain)](# "Repository") +[![Target API](https://img.shields.io/badge/target_api-34-78C257.svg)](https://developer.android.com/about/versions/14 "Android 14") +[![Minimal API](https://img.shields.io/badge/min_api-28-78C257.svg)](https://developer.android.com/about/versions/pie "Android 9 Pie") Trace locations with Android, built with Jetpack Compose.