This file contains hidden or 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
| interface Mediator { | |
| fun getFlowIntent(context: Context, flow: Flow): Intent | |
| } |
This file contains hidden or 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
| sealed class Flow { | |
| object MainFlow : Flow | |
| class FeatureFlow(data: SomeDataType) : Flow | |
| } |
This file contains hidden or 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
| interface MainFlowIntentProvider : SimpleFlowIntentProvider | |
| interface FeatureFlowIntentProvider : DataFlowIntentProvider<SomeDataType> |
This file contains hidden or 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
| interface SimpleFlowIntentProvider { | |
| fun getFlowIntent(context: Context): Intent | |
| } | |
| interface DataFlowIntentProvider<Data> where Data : Any { | |
| fun getFlowIntent(context: Context, data: Data): Intent | |
| } |
This file contains hidden or 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
| abstract class BaseActivity : AppCompatActivity() { | |
| private val navigatorHolder: NavigatorHolder by inject() | |
| protected val mediator: NavigationMediator by inject() | |
| protected abstract val navigator: Navigator | |
| override fun onResumeFragments() { | |
| super.onResumeFragments() | |
| navigatorHolder.setNavigator(navigator) |
This file contains hidden or 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
| val coreModule = module(ROOT_SCOPE) { | |
| val cicerone = Cicerone.create(FlowRouter()) | |
| single<Router> { cicerone.router } | |
| single<FlowRouter> { cicerone.router } | |
| single<NavigatorHolder> { cicerone.navigatorHolder } | |
| } |
This file contains hidden or 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
| val mediatorModule = module(ROOT_SCOPE) { | |
| single<Mediator> { NavigationMediator(get(), get()) } | |
| } |
This file contains hidden or 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
| internal class MainFlowIntentProviderImpl : MainFlowIntentProvider { | |
| override fun getFlowIntent(context: Context): Intent = context.getFlowIntentFor<MainActivity>() | |
| } |
OlderNewer