feat: added icons for cards

This commit is contained in:
2026-06-22 22:33:11 +03:00
parent d3ef728007
commit bb57ab007c
16 changed files with 455 additions and 80 deletions
@@ -0,0 +1,28 @@
package ru.omni_devel.cards
import kotlinx.serialization.Serializable
import org.json.JSONArray
@Serializable
class CardIcon(
val names: LinkedHashMap<String, String>,
val iconId: String? = null
) {
companion object {
fun parseIconsDataFromJson(json: String): List<CardIcon> {
val array = JSONArray(json)
val icons = mutableListOf<CardIcon>()
for (i in 0 until array.length()) {
val obj = array.getJSONObject(i)
icons.add(CardIcon(
names = jsonObjectToMap(obj.getJSONObject("names")),
iconId = if (obj.has("iconId")) obj.getString("iconId") else null
))
}
return icons
}
}
}