target android 34

This commit is contained in:
Hunter Kehoe 2025-03-20 22:15:23 -06:00
parent 31eadd9768
commit 6e6820891c
7 changed files with 38 additions and 24 deletions

View file

@ -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'

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.heckel.ntfy">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET"/>

View file

@ -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)
}

View file

@ -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

View file

@ -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<ImageView>(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<ImageView>(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

View file

@ -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
}
}

View file

@ -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