Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk 35 + lib updates #509

Merged
merged 3 commits into from
Jan 25, 2025
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ app/debug/*
app/schemas/*

# Mac DS_Store files
.DS_Store
.DS_Store
.kotlin/
59 changes: 31 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.devtools.ksp'
id 'org.jetbrains.kotlin.plugin.compose'
}

repositories {
mavenCentral()
google()
}

android {
compileSdk 34
compileSdk 35

signingConfigs {
debug {
Expand All @@ -19,7 +22,7 @@ android {
defaultConfig {
applicationId "com.cooper.wheellog"
minSdk 21
targetSdk 34
targetSdk 35
versionCode 125
versionName "3.1.10b"
buildConfigField 'String', 'BUILD_TIME', "\"" + new Date().format('HH:mm dd.MM.yyyy') + "\""
Expand All @@ -34,8 +37,8 @@ android {
"room.expandProjection":"true"]
}
}
kapt {
arguments {arg("room.schemaLocation", "$projectDir/schemas")}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
buildTypes {
Expand All @@ -51,7 +54,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.all { buildType ->
buildTypes.configureEach { buildType ->
// private properties
def props = new Properties()
def propsPath = "../local.properties"
Expand All @@ -68,9 +71,10 @@ android {
buildFeatures {
viewBinding true
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.2"
kotlinCompilerExtensionVersion = "1.5.3"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -111,8 +115,8 @@ dependencies {
implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.compose.material3:material3:1.1.2'
implementation 'androidx.navigation:navigation-compose:2.7.4'
implementation 'androidx.compose.material3:material3:1.3.1'
implementation 'androidx.navigation:navigation-compose:2.8.5'
implementation "androidx.compose.material:material-icons-extended:$compose_version"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
Expand All @@ -122,7 +126,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
// database
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
ksp "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
// bluetooth
implementation 'com.github.weliem:blessed-android:2.4.1'
Expand All @@ -132,40 +136,39 @@ dependencies {
// pebble
implementation 'com.getpebble:pebblekit:4.0.1'
// wearOs
implementation 'com.google.android.gms:play-services-wearable:18.1.0'
implementation 'com.google.android.gms:play-services-wearable:19.0.0'
wearApp project(':wearos')
// common
implementation "androidx.core:core-ktx:$core_ktx_version"
implementation "androidx.appcompat:appcompat:$appcompact_version"
implementation "com.google.android.material:material:$material_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'me.relex:circleindicator:2.1.6'
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'org.osmdroid:osmdroid-android:6.1.18'
implementation 'org.osmdroid:osmdroid-android:6.1.20'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation 'com.google.guava:guava:32.1.2-jre'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.google.guava:guava:33.4.0-jre'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
// coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1'
// AppMetrica SDK.
// implementation ('com.yandex.android:mobmetricalib:5.3.0') {
// exclude group: 'com.yandex.android', module: 'mobmetricalib-identifiers'
// }

testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.truth:truth:1.1.5'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'com.google.truth:truth:1.4.4'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
testImplementation 'io.mockk:mockk:1.13.14'
testImplementation 'org.robolectric:robolectric:4.14.1'
testImplementation 'androidx.test:core:1.6.1'
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.0'
testImplementation 'org.json:json:20230618'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
testImplementation 'org.json:json:20241224'
}
10 changes: 8 additions & 2 deletions app/src/main/java/com/cooper/wheellog/BluetoothService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class BluetoothService: Service() {
}
val magicPeriod = 15000
reconnectTimer = Timer().apply {
scheduleAtFixedRate(object : TimerTask() {
schedule(object : TimerTask() {
override fun run() {
val wd = WheelData.getInstance()
if (connectionState == ConnectionState.CONNECTED
Expand Down Expand Up @@ -529,6 +529,12 @@ class BluetoothService: Service() {
return mDisconnectTime
}

override fun onTimeout(startId: Int) {
super.onTimeout(startId)
Timber.e("BluetoothService stops on timeout")
stopSelf()
}

private fun startBeepTimer() {
wl = mgr?.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, wakeLogTag)?.apply {
acquire(5 * 60 * 1000L /*5 minutes*/)
Expand All @@ -545,7 +551,7 @@ class BluetoothService: Service() {
}
}
beepTimer = Timer().apply {
scheduleAtFixedRate(
schedule(
beepTimerTask,
noConnectionSound.toLong(),
noConnectionSound.toLong()
Expand Down
20 changes: 12 additions & 8 deletions app/src/main/java/com/cooper/wheellog/WheelLog.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.cooper.wheellog

import android.app.Application
// import com.yandex.metrica.YandexMetricaConfig
// import com.yandex.metrica.YandexMetrica
import com.cooper.wheellog.utils.NotificationUtil
import com.cooper.wheellog.utils.VolumeKeyController
import com.cooper.wheellog.utils.ThemeManager
import android.content.ContentResolver
import android.content.Context
import android.content.res.Configuration
Expand All @@ -32,12 +29,19 @@ class WheelLog : Application() {
// }
}

override fun attachBaseContext(base: Context) {
override fun attachBaseContext(base: Context?) {
var mContext = base
AppConfig = AppConfig(mContext)
mContext = LocaleManager.setLocale(mContext)
Notifications = NotificationUtil(mContext)
VolumeKeyController = VolumeKeyController(mContext)
if (mContext != null) {
Timber.d("attachBaseContext")
AppConfig = AppConfig(mContext)
mContext = LocaleManager.setLocale(mContext)
Notifications = NotificationUtil(mContext)
VolumeKeyController = VolumeKeyController(mContext)
}
else
{
Timber.e("attachBaseContext with null context")
}
super.attachBaseContext(mContext)
}

Expand Down
23 changes: 14 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.9.0'
ext.compose_version = '1.5.3'
ext.lifecycle_version = '2.6.2'
ext.room_version = '2.5.2'
ext.material_version = '1.10.0'
ext.appcompact_version = '1.6.1'
ext.core_ktx_version = '1.12.0'
ext.kotlin_version = '2.0.21'
ext.compose_version = '1.7.6'
ext.lifecycle_version = '2.8.7'
ext.room_version = '2.6.1'
ext.material_version = '1.12.0'
ext.appcompact_version = '1.7.0'
ext.core_ktx_version = '1.15.0'
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.android.tools.build:gradle:8.8.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Expand All @@ -22,6 +22,11 @@ buildscript {
}
}

plugins {
id 'com.google.devtools.ksp' version '2.0.21-1.0.27' apply false
id 'org.jetbrains.kotlin.plugin.compose' version '2.0.21' apply false
}

allprojects {
repositories {
mavenCentral()
Expand All @@ -31,5 +36,5 @@ allprojects {
}

tasks.register('clean', Delete) {
delete rootProject.buildDir
delete rootProject.path
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xms2560m -Xmx4096m -XX:MaxMetaspaceSize=512m -XX:ReservedCodeCacheSize=225m -XX:+UseCompressedOops
android.enableJetifier = true
android.nonFinalResIds = false
android.nonTransitiveRClass = false
android.useAndroidX = true
org.gradle.configuration-cache = true
org.gradle.jvmargs = -Xms2560m -Xmx4096m -XX:MaxMetaspaceSize=512m -XX:ReservedCodeCacheSize=225m -XX:+UseCompressedOops
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Mon Oct 12 22:53:09 MSK 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
Loading
Loading