diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index cda2bdf..8247cb4 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -2,28 +2,30 @@ 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 - - name: Set up JDK 17 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: distribution: zulu - java-version: 17 + java-version: 21 cache: gradle - name: Build with Gradle run: | 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 diff --git a/app/build.gradle b/app/build.gradle index de06d7e..fd10dab 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" } @@ -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.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.7.3' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2' } 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) { 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"> 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 @@ + 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