mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 22:55:46 +03:00
Add all section to task types
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
a52ec924ab
commit
cbc9466d29
3 changed files with 15 additions and 4 deletions
|
@ -84,14 +84,16 @@ class AssistantViewModel(client: NextcloudClient) : ViewModel() {
|
|||
|
||||
private fun getTaskTypes() {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val result = repository.getTaskTypes().resultData.types
|
||||
val result = arrayListOf(TaskType(null, "All", null))
|
||||
val taskTypes = repository.getTaskTypes().resultData.types ?: listOf()
|
||||
result.addAll(taskTypes)
|
||||
|
||||
_taskTypes.update {
|
||||
result
|
||||
result.toList()
|
||||
}
|
||||
|
||||
_selectedTaskType.update {
|
||||
result?.first()
|
||||
result.first()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,14 @@ fun AssistantScreen(viewModel: AssistantViewModel, floatingActionButton: Floatin
|
|||
}
|
||||
|
||||
floatingActionButton.setOnClickListener {
|
||||
showAddTaskAlertDialog = true
|
||||
if (selectedTaskType?.id != null) {
|
||||
showAddTaskAlertDialog = true
|
||||
} else {
|
||||
DisplayUtils.showSnackMessage(
|
||||
activity,
|
||||
activity.getString(R.string.assistant_screen_select_different_task_type_to_add)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Box(Modifier.nestedScroll(pullRefreshState.nestedScrollConnection)) {
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
<string name="assistant_screen_delete_task_alert_dialog_title">Delete Task</string>
|
||||
<string name="assistant_screen_delete_task_alert_dialog_description">Are you sure you want to delete this task?</string>
|
||||
|
||||
<string name="assistant_screen_select_different_task_type_to_add">Please select different task type to create a new task</string>
|
||||
|
||||
<string name="assistant_screen_task_more_actions_bottom_sheet_delete_action">Delete Task</string>
|
||||
|
||||
<string name="assistant_screen_task_create_success_message">Task successfully created</string>
|
||||
|
|
Loading…
Reference in a new issue