diff --git a/app/build.gradle b/app/build.gradle index 297ce1da..7d46301c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.android.application) + alias(libs.plugins.google.ksp) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.kapt) alias(libs.plugins.kotlin.parcelize) @@ -113,11 +114,9 @@ android { } } -kapt { - arguments { - arg("room.schemaLocation", "$projectDir/schemas") - arg("room.incremental", "true") - } +ksp { + arg("room.schemaLocation", "$projectDir/schemas") + arg("room.incremental", "true") } configurations { @@ -134,7 +133,7 @@ dependencies { implementation libs.bundles.androidx implementation libs.bundles.room - kapt libs.androidx.room.compiler + ksp libs.androidx.room.compiler implementation libs.android.material diff --git a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt index 9c563191..f830b5bd 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationEntity.kt @@ -89,7 +89,7 @@ data class ConversationStatusEntity( val bookmarked: Boolean, val sensitive: Boolean, val spoilerText: String, - val attachments: ArrayList, + val attachments: List, val mentions: List, val tags: List?, val showingHiddenContent: Boolean, diff --git a/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt b/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt index 6ef94254..491cd53d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/Converters.kt @@ -102,8 +102,8 @@ class Converters @Inject constructor( } @TypeConverter - fun jsonToAttachmentList(attachmentListJson: String?): ArrayList? { - return gson.fromJson(attachmentListJson, object : TypeToken>() {}.type) + fun jsonToAttachmentList(attachmentListJson: String?): List? { + return gson.fromJson(attachmentListJson, object : TypeToken>() {}.type) } @TypeConverter diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt b/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt index 87237913..c400a1af 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/DeletedStatus.kt @@ -16,7 +16,6 @@ package com.keylesspalace.tusky.entity import com.google.gson.annotations.SerializedName -import java.util.ArrayList import java.util.Date data class DeletedStatus( @@ -25,7 +24,7 @@ data class DeletedStatus( @SerializedName("spoiler_text") val spoilerText: String, val visibility: Status.Visibility, val sensitive: Boolean, - @SerializedName("media_attachments") val attachments: ArrayList?, + @SerializedName("media_attachments") val attachments: List?, val poll: Poll?, @SerializedName("created_at") val createdAt: Date, val language: String? diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt index f9599746..0b9a0796 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt @@ -19,7 +19,6 @@ import android.text.SpannableStringBuilder import android.text.style.URLSpan import com.google.gson.annotations.SerializedName import com.keylesspalace.tusky.util.parseAsMastodonHtml -import java.util.ArrayList import java.util.Date data class Status( @@ -42,7 +41,7 @@ data class Status( val sensitive: Boolean, @SerializedName("spoiler_text") val spoilerText: String, val visibility: Visibility, - @SerializedName("media_attachments") val attachments: ArrayList, + @SerializedName("media_attachments") val attachments: List, val mentions: List, val tags: List?, val application: Application?, diff --git a/build.gradle b/build.gradle index 14527214..7689e2fb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.android.application) apply false + alias(libs.plugins.google.ksp) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.kapt) apply false alias(libs.plugins.kotlin.parcelize) apply false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8407ddf4..4609a234 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -57,6 +57,7 @@ xmlwriter = "1.0.4" [plugins] android-application = { id = "com.android.application", version.ref = "agp" } +google-ksp = "com.google.devtools.ksp:1.8.22-1.0.11" kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }