增加动态举报

This commit is contained in:
2024-12-06 22:08:57 +08:00
parent 76e7bbb84a
commit 50fb1874e7
8 changed files with 428 additions and 50 deletions

View File

@@ -0,0 +1,19 @@
package com.aiosman.ravenow.entity
import android.content.Context
import com.google.gson.annotations.SerializedName
data class ReportReasons(
@SerializedName("id") var id: Int,
@SerializedName("text") var text: Map<String, String>
) {
fun getReasonText(context:Context): String? {
val language = context.resources.configuration.locale.language
val langMapping = mapOf(
"zh" to "zh",
"en" to "en"
)
val useLang = langMapping[language] ?: "en"
return text[useLang] ?: text["en"]
}
}