From 3dc4a6a00d2d921447b33aafa969e00941a8f866 Mon Sep 17 00:00:00 2001 From: Shingyx Date: Tue, 29 Jul 2025 21:19:32 +1000 Subject: [PATCH 1/5] Bump gradle, deps, jdk --- .github/workflows/android.yml | 4 ++-- app/build.gradle | 14 +++++++------- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index cda2bdf..89c5d0b 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: zulu - java-version: 17 + java-version: 21 cache: gradle - name: Build with Gradle run: | diff --git a/app/build.gradle b/app/build.gradle index de06d7e..da8053f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,17 +43,17 @@ android { viewBinding true } kotlin { - jvmToolchain(17) + jvmToolchain(21) } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1' - implementation 'com.google.android.material:material:1.9.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.appcompat:appcompat:1.7.1' + implementation 'androidx.constraintlayout:constraintlayout:2.2.1' + implementation 'com.google.android.gms:play-services-oss-licenses:17.2.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'com.jakewharton.timber:timber:5.0.1' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2' } diff --git a/build.gradle b/build.gradle index 536cd32..0fcd875 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.8.20' + ext.kotlin_version = '2.1.20' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' + classpath 'com.android.tools.build:gradle:8.11.1' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8aa9699..8ff0a5f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Jan 21 08:03:01 AEDT 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From bab955390bb635a69c746b8e0fa6bd32301592a8 Mon Sep 17 00:00:00 2001 From: Shingyx Date: Tue, 29 Jul 2025 22:25:01 +1000 Subject: [PATCH 2/5] SDK 36, lints --- app/build.gradle | 4 ++-- .../github/shingyx/boomswitch/data/Preferences.kt | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index da8053f..0efcf78 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,11 +20,11 @@ android { keyPassword keystoreProperties['keyPassword'] } } - compileSdk 34 + compileSdk 36 defaultConfig { applicationId "com.github.shingyx.boomswitch" minSdk 23 - targetSdk 34 + targetSdk 36 versionCode 12 versionName "1.8" } diff --git a/app/src/main/java/com/github/shingyx/boomswitch/data/Preferences.kt b/app/src/main/java/com/github/shingyx/boomswitch/data/Preferences.kt index 388ecdc..3d6c09f 100644 --- a/app/src/main/java/com/github/shingyx/boomswitch/data/Preferences.kt +++ b/app/src/main/java/com/github/shingyx/boomswitch/data/Preferences.kt @@ -3,6 +3,7 @@ package com.github.shingyx.boomswitch.data import android.content.Context import android.content.SharedPreferences import androidx.appcompat.app.AppCompatDelegate +import androidx.core.content.edit object Preferences { private const val SHARED_PREFERENCES_NAME = "BoomSwitchData" @@ -19,10 +20,10 @@ object Preferences { return BluetoothDeviceInfo(name, address) } set(value) { - sharedPreferences.edit() - .putString(KEY_DEVICE_NAME, value?.name) - .putString(KEY_DEVICE_ADDRESS, value?.address) - .apply() + sharedPreferences.edit { + putString(KEY_DEVICE_NAME, value?.name) + putString(KEY_DEVICE_ADDRESS, value?.address) + } } var appColorTheme: AppColorTheme @@ -31,9 +32,9 @@ object Preferences { return AppColorTheme.fromNightModeValue(nightModeValue) } set(value) { - sharedPreferences.edit() - .putInt(KEY_NIGHT_MODE, value.nightModeValue) - .apply() + sharedPreferences.edit { + putInt(KEY_NIGHT_MODE, value.nightModeValue) + } } fun initialize(context: Context) { From 7402224ccdffc48ce357d773d051e07c92ea5d4b Mon Sep 17 00:00:00 2001 From: Shingyx Date: Tue, 29 Jul 2025 22:54:52 +1000 Subject: [PATCH 3/5] Fix edge-to-edge layouts --- app/build.gradle | 2 +- app/src/main/res/layout/activity_create_shortcut.xml | 1 + app/src/main/res/layout/activity_help.xml | 1 + app/src/main/res/layout/activity_main.xml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 0efcf78..fd10dab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -52,7 +52,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.7.1' implementation 'androidx.constraintlayout:constraintlayout:2.2.1' - implementation 'com.google.android.gms:play-services-oss-licenses:17.2.0' + implementation 'com.google.android.gms:play-services-oss-licenses:17.2.1' implementation 'com.google.android.material:material:1.12.0' implementation 'com.jakewharton.timber:timber:5.0.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2' diff --git a/app/src/main/res/layout/activity_create_shortcut.xml b/app/src/main/res/layout/activity_create_shortcut.xml index 0d5bf35..138ee53 100644 --- a/app/src/main/res/layout/activity_create_shortcut.xml +++ b/app/src/main/res/layout/activity_create_shortcut.xml @@ -2,6 +2,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" + android:fitsSystemWindows="true" android:orientation="vertical"> From 19a074975e9711470e5b6a2045774ef0d8413997 Mon Sep 17 00:00:00 2001 From: Shingyx Date: Tue, 29 Jul 2025 23:29:48 +1000 Subject: [PATCH 4/5] monochrome icon --- app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index f496787..5260697 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,4 +1,5 @@ + From 9571e884418c355f7898730b4b63fe4729419561 Mon Sep 17 00:00:00 2001 From: Shingyx Date: Tue, 29 Jul 2025 23:37:35 +1000 Subject: [PATCH 5/5] Bump actions versions --- .github/workflows/android.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 89c5d0b..8247cb4 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -2,18 +2,20 @@ name: Android CI on: push: - branches: [ 'master' ] + branches: + - master pull_request: - branches: [ 'master' ] + branches: + - master workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: zulu java-version: 21 @@ -23,7 +25,7 @@ jobs: chmod +x gradlew ./gradlew --no-daemon buildDebug assembleDebug - name: Upload debug apk - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: boom-switch-debug-apk path: app/build/outputs/apk/debug/app-debug.apk