Menambahkan Activity di Andorid Manifest
This commit is contained in:
parent
327c9048a4
commit
9807c900dd
@ -30,6 +30,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".JalurEvakuasiActivity" />
|
<activity android:name=".JalurEvakuasiActivity" />
|
||||||
|
<activity android:name=".AlertActivity" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -69,7 +69,7 @@ fun AlertScreen() {
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "⚠ SISTEM ALERT DARURAT",
|
text = "⚠️ SISTEM ALERT DARURAT",
|
||||||
fontSize = 24.sp,
|
fontSize = 24.sp,
|
||||||
color = Color.Red,
|
color = Color.Red,
|
||||||
modifier = Modifier.padding(bottom = 8.dp)
|
modifier = Modifier.padding(bottom = 8.dp)
|
||||||
@ -87,7 +87,7 @@ fun AlertScreen() {
|
|||||||
"🔥 KEBAKARAN" to "fire",
|
"🔥 KEBAKARAN" to "fire",
|
||||||
"🌊 BANJIR/TSUNAMI" to "ocean",
|
"🌊 BANJIR/TSUNAMI" to "ocean",
|
||||||
"🌏 GEMPA BUMI" to "earth_asia",
|
"🌏 GEMPA BUMI" to "earth_asia",
|
||||||
"☢ BAHAYA RADIASI" to "radioactive",
|
"☢️ BAHAYA RADIASI" to "radioactive",
|
||||||
"🚨 EVAKUASI SEGERA" to "rotating_light"
|
"🚨 EVAKUASI SEGERA" to "rotating_light"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ fun sendQuickAlert(url: String, alertType: String, tag: String, onResult: (Strin
|
|||||||
val client = OkHttpClient()
|
val client = OkHttpClient()
|
||||||
|
|
||||||
val message = """
|
val message = """
|
||||||
⚠ ALERT DARURAT ⚠
|
⚠️ ALERT DARURAT ⚠️
|
||||||
|
|
||||||
Jenis: $alertType
|
Jenis: $alertType
|
||||||
Waktu: ${java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss", java.util.Locale.getDefault()).format(java.util.Date())}
|
Waktu: ${java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss", java.util.Locale.getDefault()).format(java.util.Date())}
|
||||||
@ -261,4 +261,3 @@ fun sendCustomAlert(url: String, customMessage: String, onResult: (String) -> Un
|
|||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -148,7 +148,7 @@ fun MyApp() {
|
|||||||
onClick = { showSettingsDialog = true },
|
onClick = { showSettingsDialog = true },
|
||||||
colors = ButtonDefaults.buttonColors(containerColor = Color.Gray)
|
colors = ButtonDefaults.buttonColors(containerColor = Color.Gray)
|
||||||
) {
|
) {
|
||||||
Text("⚙", fontSize = 18.sp)
|
Text("⚙️", fontSize = 18.sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,9 +161,9 @@ fun MyApp() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
listOf(
|
listOf(
|
||||||
"🔥 Kebakaran", "⛈ Banjir", "🌊 Tsunami", "🌋 Gunung Meletus",
|
"🔥 Kebakaran", "⛈️ Banjir", "🌊 Tsunami", "🌋 Gunung Meletus",
|
||||||
"🌏 Gempa Bumi", "👿 Huru hara", "🐍 Binatang Buas",
|
"🌏 Gempa Bumi", "👿 Huru hara", "🐍 Binatang Buas",
|
||||||
"☢ Radiasi Nuklir", "☣ Biohazard"
|
"☢️ Radiasi Nuklir", "☣️ Biohazard"
|
||||||
).forEach { condition ->
|
).forEach { condition ->
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -228,7 +228,7 @@ fun MyApp() {
|
|||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "JANGAN PANIK! SEGERA EVAKUASI DIRI ANDA KE TITIK KUMPUL",
|
text = "JANGAN PANIK! SEGERA EVAKUASI\nDIRI ANDA KE TITIK KUMPUL",
|
||||||
color = Color.Red,
|
color = Color.Red,
|
||||||
fontSize = 15.sp
|
fontSize = 15.sp
|
||||||
)
|
)
|
||||||
@ -252,14 +252,14 @@ fun sendNotification(url: String, condition: String, report: String, onResult: (
|
|||||||
|
|
||||||
val tagMapping = mapOf(
|
val tagMapping = mapOf(
|
||||||
"🔥 Kebakaran" to "fire",
|
"🔥 Kebakaran" to "fire",
|
||||||
"⛈ Banjir" to "cloud_with_lightning_and_rain",
|
"⛈️ Banjir" to "cloud_with_lightning_and_rain",
|
||||||
"🌊 Tsunami" to "ocean",
|
"🌊 Tsunami" to "ocean",
|
||||||
"🌋 Gunung Meletus" to "volcano",
|
"🌋 Gunung Meletus" to "volcano",
|
||||||
"🌏 Gempa Bumi" to "earth_asia",
|
"🌏 Gempa Bumi" to "earth_asia",
|
||||||
"👿 Huru hara" to "imp",
|
"👿 Huru hara" to "imp",
|
||||||
"🐍 Binatang Buas" to "snake",
|
"🐍 Binatang Buas" to "snake",
|
||||||
"☢ Radiasi Nuklir" to "radioactive",
|
"☢️ Radiasi Nuklir" to "radioactive",
|
||||||
"☣ Biohazard" to "biohazard"
|
"☣️ Biohazard" to "biohazard"
|
||||||
)
|
)
|
||||||
|
|
||||||
val selectedList = condition
|
val selectedList = condition
|
||||||
@ -278,7 +278,7 @@ fun sendNotification(url: String, condition: String, report: String, onResult: (
|
|||||||
)
|
)
|
||||||
val request = Request.Builder()
|
val request = Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.addHeader("Title", "⚠ ALERT - Kondisi Darurat")
|
.addHeader("Title", "⚠️ ALERT - Kondisi Darurat")
|
||||||
.addHeader("Priority", "urgent")
|
.addHeader("Priority", "urgent")
|
||||||
.addHeader("Tags", finalTags.joinToString(","))
|
.addHeader("Tags", finalTags.joinToString(","))
|
||||||
.post(requestBody)
|
.post(requestBody)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user