-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
79 changed files
with
1,448 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 32 additions & 8 deletions
40
app/src/main/java/com/costular/atomtasks/ui/home/AppNavigator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,59 @@ | ||
package com.costular.atomtasks.ui.home | ||
|
||
import androidx.navigation.NavController | ||
import com.costular.atomtasks.agenda.ui.AgendaNavigator | ||
import com.atomtasks.feature.detail.destinations.TaskDetailScreenDestination | ||
import com.costular.atomtasks.agenda.destinations.TasksActionsBottomSheetDestination | ||
import com.costular.atomtasks.agenda.ui.AgendaNavigator | ||
import com.costular.atomtasks.createtask.destinations.CreateTaskScreenDestination | ||
import com.costular.atomtasks.feature.edittask.destinations.EditTaskScreenDestination | ||
import com.costular.atomtasks.settings.SettingsNavigator | ||
import com.costular.atomtasks.settings.destinations.ThemeSelectorScreenDestination | ||
import com.ramcosta.composedestinations.navigation.navigate | ||
import com.ramcosta.composedestinations.utils.toDestinationsNavigator | ||
import java.time.LocalDate | ||
|
||
class AppNavigator( | ||
private val navController: NavController, | ||
) : SettingsNavigator, AgendaNavigator { | ||
|
||
override fun navigateToCreateTask(date: String, text: String?) { | ||
navController.navigate(CreateTaskScreenDestination(text = text, date = date)) | ||
private val destinationsNavigator by lazy { | ||
navController.toDestinationsNavigator() | ||
} | ||
|
||
override fun navigateToCreateTask(date: String) { | ||
destinationsNavigator.navigate(CreateTaskScreenDestination(date)) | ||
} | ||
|
||
override fun navigateToEditTask(taskId: Long) { | ||
navController.navigate(EditTaskScreenDestination(taskId)) | ||
destinationsNavigator.navigate(EditTaskScreenDestination(taskId)) | ||
} | ||
|
||
override fun navigateToDetailScreenForCreateTask(date: String) { | ||
destinationsNavigator.navigate( | ||
TaskDetailScreenDestination( | ||
defaultDate = LocalDate.parse(date), | ||
taskId = null, | ||
) | ||
) | ||
} | ||
|
||
override fun navigateToDetailScreenToEdit(taskId: Long) { | ||
destinationsNavigator.navigate( | ||
TaskDetailScreenDestination( | ||
defaultDate = null, | ||
taskId = taskId | ||
) | ||
) | ||
} | ||
|
||
override fun openTaskActions(taskId: Long, taskName: String, isDone: Boolean) { | ||
navController.navigate(TasksActionsBottomSheetDestination(taskId, taskName, isDone)) | ||
destinationsNavigator.navigate(TasksActionsBottomSheetDestination(taskId, taskName, isDone)) | ||
} | ||
|
||
override fun navigateUp() { | ||
navController.navigateUp() | ||
destinationsNavigator.navigateUp() | ||
} | ||
|
||
override fun navigateToSelectTheme(theme: String) { | ||
navController.navigate(ThemeSelectorScreenDestination(theme)) | ||
destinationsNavigator.navigate(ThemeSelectorScreenDestination(theme)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
feature/agenda/src/main/java/com/costular/atomtasks/agenda/ui/AgendaUiEvents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.costular.atomtasks.agenda.ui | ||
|
||
import com.costular.atomtasks.core.ui.mvi.UiEvent | ||
import java.time.LocalDate | ||
|
||
sealed interface AgendaUiEvents : UiEvent { | ||
|
||
data class GoToNewTaskScreen( | ||
val date: LocalDate, | ||
val shouldShowNewScreen: Boolean, | ||
) : AgendaUiEvents | ||
|
||
data class GoToEditScreen( | ||
val taskId: Long, | ||
val shouldShowNewScreen: Boolean, | ||
) : AgendaUiEvents | ||
} |
Oops, something went wrong.