Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_create_shortcut.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<com.google.android.material.appbar.AppBarLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ui.HelpActivity">

<LinearLayout
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".ui.MainActivity">

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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