first workting version
This commit is contained in:
1 parent
830765cb13
commit
d2048ea5b7
23 files changed
+292
-86
No files matched your search
@@ -9,11 +9,11 @@ import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.input.key.*
|
||||
import androidx.compose.ui.unit.dp
|
||||
import ch.ergon.anytask.api.AnyTypeClient
|
||||
import ch.ergon.anytask.api.AnyTypeApi
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
fun TaskWindow(client: AnyTypeClient, onDismiss: () -> Unit) {
|
||||
fun TaskWindow(client: AnyTypeApi, onDismiss: () -> Unit) {
|
||||
val scope = rememberCoroutineScope()
|
||||
var title by remember { mutableStateOf("") }
|
||||
var details by remember { mutableStateOf("") }
|
||||
@@ -58,12 +58,12 @@ fun TaskWindow(client: AnyTypeClient, onDismiss: () -> Unit) {
|
||||
},
|
||||
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||
) {
|
||||
Text("Neue Aufgabe", style = MaterialTheme.typography.h6)
|
||||
Text("New Task", style = MaterialTheme.typography.h6)
|
||||
|
||||
OutlinedTextField(
|
||||
value = title,
|
||||
onValueChange = { title = it },
|
||||
label = { Text("Titel") },
|
||||
label = { Text("Title") },
|
||||
singleLine = true,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@@ -86,10 +86,10 @@ fun TaskWindow(client: AnyTypeClient, onDismiss: () -> Unit) {
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.End),
|
||||
) {
|
||||
TextButton(onClick = onDismiss) { Text("Abbrechen") }
|
||||
TextButton(onClick = onDismiss) { Text("Cancel") }
|
||||
Button(onClick = ::submit, enabled = title.isNotBlank() && !isLoading) {
|
||||
if (isLoading) CircularProgressIndicator(modifier = Modifier.size(16.dp), strokeWidth = 2.dp)
|
||||
else Text("Erstellen ⌘↵")
|
||||
else Text("Create ⌘↵")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||