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 LceGesture { | |
| /** | |
| * Item to load clicked | |
| * @property id Item ID to load | |
| */ | |
| data class ItemClicked(val id: ItemId) : LceGesture() | |
| /** | |
| * Retry operation clicked | |
| */ |
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
| import {assistantConversation} from "./assistant"; | |
| async function main() { | |
| await assistantConversation(); | |
| } | |
| main(); |
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
| package com.myexample | |
| import io.mockk.every | |
| import io.mockk.mockk | |
| import io.mockk.verify | |
| import org.junit.Test | |
| import kotlin.test.assertEquals | |
| interface CallContext |
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
| @AndroidEntryPoint | |
| class MainActivity : BaseActivity() { | |
| // The model to run authentication and content visibility | |
| private val model: MainScreenModel by viewModels | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| MainContent(model) { |
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
| /** | |
| * Common interface to start feature-flow | |
| */ | |
| interface FlowStarter<G: Any, U: Any> { | |
| /** | |
| * Creates a starting state | |
| * @param email Email to proceed with | |
| */ | |
| fun start(email: String): CommonMachineState<G, U> | |
| } |
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 WelcomeFeatureHost { | |
| /** | |
| * Returns user to email entry screen | |
| */ | |
| fun backToEmailEntry() | |
| /** | |
| * Authentication complete | |
| */ | |
| fun complete() |
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
| class EmailCheckState( | |
| context: WelcomeContext, | |
| private val data: WelcomeDataState, | |
| private val checkEmail: CheckEmail | |
| ) : WelcomeState(context) { | |
| private val email = requireNotNull(data.email) { | |
| "Email is not provided" | |
| } |
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
| /** | |
| * Proxy definition (for readability) | |
| */ | |
| private typealias LoginProxy = ProxyMachineState< | |
| WelcomeGesture, // Host gesture system | |
| WelcomeUiState, // Host ui-state system | |
| LoginGesture, // Feature gesture system | |
| LoginUiState // Feature ui-state system | |
| > |
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 ProxyMachineState<PG: Any, PU: Any, CG: Any, CU: Any> : CommonMachineState<PG, PU>() { | |
| /** | |
| * Proxy state machine | |
| */ | |
| private val machine = object : CommonStateMachine.Base<CG, CU>(::init) { | |
| fun doStart() { | |
| start() | |
| } |
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
| /** | |
| * Common state machine | |
| * @param G UI gesture | |
| * @param U UI state | |
| */ | |
| interface CommonStateMachine<G: Any, U: Any> : MachineInput<G>, MachineOutput<G, U> | |
| /** | |
| * Common state-machine state | |
| * @param G UI gesture |
NewerOlder