diff --git a/app/build.gradle b/app/build.gradle index 90dc1edb..2990a460 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,18 +1,23 @@ +plugins { + id 'com.google.devtools.ksp' +} + repositories { mavenCentral() } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' +//apply plugin: 'kotlin-kapt' apply plugin: 'com.google.gms.google-services' android { - compileSdkVersion 33 + namespace "io.heckel.ntfy" + compileSdkVersion 34 defaultConfig { applicationId "io.heckel.ntfy" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 33 versionName "1.17.0" @@ -25,6 +30,10 @@ android { arguments += ["room.schemaLocation": "$projectDir/schemas".toString()] } } + + buildFeatures { + buildConfig true + } } buildTypes { @@ -54,12 +63,12 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() freeCompilerArgs += [ '-Xjvm-default=all-compatibility' // https://stackoverflow.com/a/71234042/1440785 ] @@ -103,9 +112,10 @@ dependencies { implementation 'com.google.code.gson:gson:2.10' // Room (SQLite) - def room_version = "2.5.1" + def room_version = "2.6.1" + implementation "androidx.room:room-runtime:$room_version" + ksp "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-ktx:$room_version" - kapt "androidx.room:room-compiler:$room_version" // OkHttp (HTTP library) implementation 'com.squareup.okhttp3:okhttp:4.10.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0950b404..67246fe5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/app/src/main/java/io/heckel/ntfy/db/Database.kt b/app/src/main/java/io/heckel/ntfy/db/Database.kt index 5f397969..f7e3a2ad 100644 --- a/app/src/main/java/io/heckel/ntfy/db/Database.kt +++ b/app/src/main/java/io/heckel/ntfy/db/Database.kt @@ -120,7 +120,7 @@ data class Attachment( @ColumnInfo(name = "contentUri") val contentUri: String?, // After it's downloaded, the content:// location @ColumnInfo(name = "progress") val progress: Int, // Progress during download, -1 if not downloaded ) { - constructor(name: String, type: String?, size: Long?, expires: Long?, url: String) : + @Ignore constructor(name: String, type: String?, size: Long?, expires: Long?, url: String) : this(name, type, size, expires, url, null, ATTACHMENT_PROGRESS_NONE) } @@ -135,7 +135,7 @@ data class Icon( @ColumnInfo(name = "url") val url: String, // URL (mandatory, see ntfy server) @ColumnInfo(name = "contentUri") val contentUri: String?, // After it's downloaded, the content:// location ) { - constructor(url:String) : + @Ignore constructor(url:String) : this(url, null) } @@ -192,7 +192,7 @@ data class LogEntry( @ColumnInfo(name = "message") val message: String, @ColumnInfo(name = "exception") val exception: String? ) { - constructor(timestamp: Long, tag: String, level: Int, message: String, exception: String?) : + @Ignore constructor(timestamp: Long, tag: String, level: Int, message: String, exception: String?) : this(0, timestamp, tag, level, message, exception) } diff --git a/app/src/main/java/io/heckel/ntfy/ui/Colors.kt b/app/src/main/java/io/heckel/ntfy/ui/Colors.kt index ada14cbf..47e8e164 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/Colors.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/Colors.kt @@ -7,7 +7,7 @@ import io.heckel.ntfy.util.isDarkThemeOn class Colors { companion object { - const val refreshProgressIndicator = R.color.teal + val refreshProgressIndicator = R.color.teal fun notificationIcon(context: Context): Int { return if (isDarkThemeOn(context)) R.color.teal_light else R.color.teal diff --git a/app/src/main/java/io/heckel/ntfy/util/Util.kt b/app/src/main/java/io/heckel/ntfy/util/Util.kt index 2ffbb766..1db243fe 100644 --- a/app/src/main/java/io/heckel/ntfy/util/Util.kt +++ b/app/src/main/java/io/heckel/ntfy/util/Util.kt @@ -393,13 +393,14 @@ class ContentUriRequestBody( } } +// TODO: make this work in Android 34+ // Hack: Make end icon for drop down smaller, see https://stackoverflow.com/a/57098715/1440785 fun View.makeEndIconSmaller(resources: Resources) { - val dimension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics) - val endIconImageView = findViewById(R.id.text_input_end_icon) - endIconImageView.minimumHeight = dimension.toInt() - endIconImageView.minimumWidth = dimension.toInt() - requestLayout() +// val dimension = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30f, resources.displayMetrics) +// val endIconImageView = findViewById(R.id.text_input_end_icon) +// endIconImageView.minimumHeight = dimension.toInt() +// endIconImageView.minimumWidth = dimension.toInt() +// requestLayout() } // Shows the ripple effect on the view, if it is ripple-able, see https://stackoverflow.com/a/56314062/1440785 diff --git a/build.gradle b/build.gradle index fd508003..8cc4348b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { - ext.kotlin_version = '1.8.20' + ext.kotlin_version = '2.0.21' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.7.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.15' // This is removed in the "fdroid" flavor @@ -14,6 +14,10 @@ buildscript { } } +plugins { + id 'com.google.devtools.ksp' version '2.0.21-1.0.27' +} + allprojects { repositories { google() @@ -24,4 +28,4 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index edb3793b..dcbbf23b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Sep 22 10:13:03 PDT 2020 +#Sat Feb 22 14:52:01 MST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip