Menyesuaikan

This commit is contained in:
202310715297 RAIHAN ARIQ MUZAKKI 2025-11-20 21:08:33 +07:00
parent b26ebf147a
commit 366074187a
3 changed files with 17 additions and 14 deletions

View File

@ -0,0 +1,4 @@
kotlin version: 2.0.21
error message: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

View File

@ -68,9 +68,9 @@ fun MyApp() {
)
listOf(
"Kebakaran", "Banjir", "Tsunami", "Gunung Meletus",
"Gempa Bumi", "Huru hara", "Binatang Buas",
"Radiasi Nuklir", "Biohazard"
"\uD83D\uDD25 Kebakaran", "\uFE0F Banjir", "\uD83C\uDF0A Tsunami", "\uD83C\uDF0B Gunung Meletus",
"\uD83C\uDF0F Gempa Bumi", "\uD83D\uDC7F Huru hara", "\uD83D\uDC0D Binatang Buas",
"\uFE0F Radiasi Nuklir", "\uFE0F Biohazard"
).forEach { condition ->
Row(
modifier = Modifier
@ -159,15 +159,15 @@ fun sendNotification(condition: String, report: String, onResult: (String) -> Un
// Mapping kondisi → emoji/tag
val tagMapping = mapOf(
"Kebakaran" to "fire",
"Banjir" to "ocean",
"Tsunami" to "ocean",
"Gunung Meletus" to "volcano",
"Gempa Bumi" to "earth_asia",
"Huru hara" to "imp",
"Binatang Buas" to "snake",
"Radiasi Nuklir" to "radioactive",
"Biohazard" to "biohazard"
"\uD83D\uDD25 Kebakaran" to "fire",
"\uFE0F Banjir" to "cloud_with_lightning_and_rain",
"\uD83C\uDF0A Tsunami" to "ocean",
"\uD83C\uDF0B Gunung Meletus" to "volcano",
"\uD83C\uDF0F Gempa Bumi" to "earth_asia",
"\uD83D\uDC7F Huru hara" to "imp",
"\uD83D\uDC0D Binatang Buas" to "snake",
"\uFE0F Radiasi Nuklir" to "radioactive",
"\uFE0F Biohazard" to "biohazard"
)
// Bersihkan kondisi: trim + filter
@ -183,7 +183,7 @@ fun sendNotification(condition: String, report: String, onResult: (String) -> Un
val emojiTags = selectedList.mapNotNull { tagMapping[it] }
// Tambahkan default tag: alert + warning
val finalTags = listOf("Alert", "Warning") + emojiTags
val finalTags = listOf("Alert") + emojiTags
val finalReport = "Kondisi: $cleanConditionText\nCatatan: ${report.substringAfter("Catatan:")}"
val requestBody = RequestBody.create(
@ -194,7 +194,6 @@ fun sendNotification(condition: String, report: String, onResult: (String) -> Un
.url(url)
.addHeader("Title", "Alert")
.addHeader("Priority", "urgent")
.addHeader("Tags", "alert warning,radioactive")
.addHeader("Tags", finalTags.joinToString(","))
.post(requestBody)
.build()

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB