Wottrich / android-smart-checklist

SmartChecklist is an application with high end technologies about do your tasks easily.
https://play.google.com/store/apps/details?id=wottrich.github.io.androidsmartchecklist
MIT License
8 stars 0 forks source link

New Navigation Architecture #91

Closed Wottrich closed 1 year ago

Wottrich commented 1 year ago

Task

closes #90

Context

Create new navigation architecture to the application.

The new architecture is based on AppNavigator and use Koin bind to providers navigators into project modules.


class MyContextNavigator : SmartChecklistNavigation

single { MyContextNavigator() } bind SmartChecklistNavigation::class

class AppNavigator(private val navigators: List<SmartChecklistNavigation>) {
    fun buildNavigators(navGraphBuilder: NavGraphBuilder, navHostController: NavHostController) {
        navigators.forEach {
            it.startNavigation(navGraphBuilder, navHostController)
        }
    }
}

single { AppNavigator(getAll<SmartChecklistNavigation>()) }