Move last usages of Toast to use new UiFeedback.showMessage

This commit is contained in:
Olof Hedman
2025-09-24 16:32:16 +02:00
parent 642e546a09
commit ed3cf0e56a

View File

@@ -11,7 +11,6 @@ import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.compose.setContent
@@ -838,7 +837,7 @@ private fun KlottrAppShell(
}
}
}
Toast.makeText(context, "Alla fynd rensade.", Toast.LENGTH_SHORT).show()
UiFeedback.showMessage( "Alla fynd rensade.", UiFeedbackDuration.SHORT)
},
onClose = { showSettings = false }
)
@@ -899,7 +898,7 @@ private fun KlottrAppShell(
onClose = { showWrite = false },
onSave = { draft, selLat, selLon ->
if (!loggedIn) {
Toast.makeText(context, "Du måste logga in för att kunna klottra.", Toast.LENGTH_SHORT).show()
UiFeedback.showMessage("Du måste logga in för att kunna klottra.", UiFeedbackDuration.SHORT)
return@WriteDocDialog
}
val created = System.currentTimeMillis()
@@ -1289,7 +1288,7 @@ private fun WriteDocDialog(
onClick = {
val L = LastLocationStore.lastKnownLocation.value
if (L == null) {
Toast.makeText(context, "Ingen plats ännu – försök igen.", Toast.LENGTH_SHORT).show()
UiFeedback.showMessage("Ingen plats ännu – försök igen.", UiFeedbackDuration.SHORT)
} else {
selectedLat = L.lat
selectedLon = L.lon
@@ -1362,12 +1361,12 @@ private fun WriteDocDialog(
val titleText = title.trim()
if (titleText.isEmpty()) {
titleError = "Rubrik får inte vara tom"
Toast.makeText(context, "Rubrik får inte vara tom", Toast.LENGTH_SHORT).show()
UiFeedback.showMessage( "Rubrik får inte vara tom", UiFeedbackDuration.SHORT)
return@Button
}
if (selectedLat == null || selectedLon == null) {
Toast.makeText(context, "Ingen plats ännu – klicka ”Uppdatera position”.", Toast.LENGTH_SHORT).show()
UiFeedback.showMessage("Ingen plats ännu – klicka ”Uppdatera position”.", UiFeedbackDuration.SHORT)
return@Button
}
saving = true