Move last usages of Toast to use new UiFeedback.showMessage
This commit is contained in:
@@ -11,7 +11,6 @@ import android.net.Uri
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.compose.setContent
|
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 }
|
onClose = { showSettings = false }
|
||||||
)
|
)
|
||||||
@@ -899,7 +898,7 @@ private fun KlottrAppShell(
|
|||||||
onClose = { showWrite = false },
|
onClose = { showWrite = false },
|
||||||
onSave = { draft, selLat, selLon ->
|
onSave = { draft, selLat, selLon ->
|
||||||
if (!loggedIn) {
|
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
|
return@WriteDocDialog
|
||||||
}
|
}
|
||||||
val created = System.currentTimeMillis()
|
val created = System.currentTimeMillis()
|
||||||
@@ -1289,7 +1288,7 @@ private fun WriteDocDialog(
|
|||||||
onClick = {
|
onClick = {
|
||||||
val L = LastLocationStore.lastKnownLocation.value
|
val L = LastLocationStore.lastKnownLocation.value
|
||||||
if (L == null) {
|
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 {
|
} else {
|
||||||
selectedLat = L.lat
|
selectedLat = L.lat
|
||||||
selectedLon = L.lon
|
selectedLon = L.lon
|
||||||
@@ -1362,12 +1361,12 @@ private fun WriteDocDialog(
|
|||||||
val titleText = title.trim()
|
val titleText = title.trim()
|
||||||
if (titleText.isEmpty()) {
|
if (titleText.isEmpty()) {
|
||||||
titleError = "Rubrik får inte vara tom"
|
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
|
return@Button
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedLat == null || selectedLon == null) {
|
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
|
return@Button
|
||||||
}
|
}
|
||||||
saving = true
|
saving = true
|
||||||
|
|||||||
Reference in New Issue
Block a user