AddRegex updated

This commit is contained in:
Florian 2025-01-17 09:44:43 +01:00
parent b908de01ba
commit de6dea515f
3 changed files with 2 additions and 9 deletions

View File

@ -87,12 +87,10 @@ fun EditCategory(
}
)
}else if(deleteStarted && !showError){
Log.w("xaver", "delete")
editCategoryViewModel.deleteEntry()
onButtonClick()
}
Log.w("xaver", "deleteStarted $deleteStarted : showError $showError" )
Column(
modifier = modifier

View File

@ -105,7 +105,6 @@ fun Add(
.fillMaxWidth()
)
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = { expanded = it }
@ -167,11 +166,8 @@ fun Add(
modifier = Modifier,
"Add Transaction",
onClick = {
val isValidSpending = spending.matches(Regex("^[+-]?\\d*(\\.\\d+)?$"))
Log.w("xaxaxa", name.isNotBlank().toString() )
Log.w("xaxaxa", isValidSpending.toString() )
Log.w("xaxaxa", (selectedDate != 0L).toString() )
Log.w("xaxaxa", (selectedCategory != -1).toString() )
val isValidSpending = spending.matches(Regex("^[+-]?\\d*(\\.\\d{0,2})?$"))
if (name.isNotBlank() && isValidSpending && selectedDate != 0L && selectedCategory != -1) {
val newEntry = Entry(
id = 0,

View File

@ -41,7 +41,6 @@ class AddViewModel(
}
fun addEntryToDB(entry: Entry) {
//Log.d("KRAUSI", "WE ARE INNNN")
viewModelScope.launch {
try {
val entryEntity = Entry(