SettingsViewModel

class SettingsViewModel(dispatchersProvider: DispatchersProvider, getStableDiffusionModelsUseCase: GetStableDiffusionModelsUseCase, observeStabilityAiCreditsUseCase: ObserveStabilityAiCreditsUseCase, val selectStableDiffusionModelUseCase: SelectStableDiffusionModelUseCase, val clearAppCacheUseCase: ClearAppCacheUseCase, val preferenceManager: PreferenceManager, val debugMenuAccessor: DebugMenuAccessor, val buildInfoProvider: BuildInfoProvider, val linksProvider: LinksProvider, val router: SettingsRouter, val platformActions: SettingsPlatformActions, val onError: (Throwable) -> Unit = {}) : BaseMviViewModel<SettingsState, SettingsIntent, EmptyEffect> (source)

Coordinates SettingsViewModel behavior in the SDAI presentation layer.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor(dispatchersProvider: DispatchersProvider, getStableDiffusionModelsUseCase: GetStableDiffusionModelsUseCase, observeStabilityAiCreditsUseCase: ObserveStabilityAiCreditsUseCase, selectStableDiffusionModelUseCase: SelectStableDiffusionModelUseCase, clearAppCacheUseCase: ClearAppCacheUseCase, preferenceManager: PreferenceManager, debugMenuAccessor: DebugMenuAccessor, buildInfoProvider: BuildInfoProvider, linksProvider: LinksProvider, router: SettingsRouter, platformActions: SettingsPlatformActions, onError: (Throwable) -> Unit = {})

Properties

Link copied to clipboard
private val _effect: Channel<E>
Link copied to clipboard
private val _state: MutableStateFlow<S>
Link copied to clipboard
private val appVersionProducer: Flow<String>
Link copied to clipboard

Exposes the buildInfoProvider value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the clearAppCacheUseCase value used by the SDAI presentation layer.

Link copied to clipboard
Link copied to clipboard

Exposes the debugMenuAccessor value used by the SDAI presentation layer.

Link copied to clipboard
open override val effect: Flow<EmptyEffect>
Link copied to clipboard
private val effectDispatcher: CoroutineDispatcher
Link copied to clipboard
private val immediateDispatcher: CoroutineDispatcher
Link copied to clipboard
private val ioDispatcher: CoroutineDispatcher
Link copied to clipboard

Exposes the linksProvider value used by the SDAI presentation layer.

Link copied to clipboard
private val onError: (Throwable) -> Unit

Exposes the onError value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the platformActions value used by the SDAI presentation layer.

Link copied to clipboard

Exposes the preferenceManager value used by the SDAI presentation layer.

Link copied to clipboard
private val router: SettingsRouter

Exposes the router value used by the SDAI presentation layer.

Link copied to clipboard
Link copied to clipboard

Exposes the selectStableDiffusionModelUseCase value used by the SDAI presentation layer.

Link copied to clipboard
private val stabilityCreditsProducer: Flow<Float>
Link copied to clipboard
open override val state: StateFlow<SettingsState>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal expect fun clear()
Link copied to clipboard
private fun clearAppCache()
Link copied to clipboard
protected fun emitEffect(effect: EmptyEffect)
Link copied to clipboard
protected fun emitState(state: SettingsState)
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
protected fun launch(dispatcher: CoroutineDispatcher, start: CoroutineStart, block: suspend CoroutineScope.() -> Unit): Job
Link copied to clipboard
protected expect open fun onCleared()
Link copied to clipboard
open override fun processIntent(intent: SettingsIntent)
Link copied to clipboard
private fun selectSdModel(value: String)
Link copied to clipboard
protected fun updateState(mutation: (SettingsState) -> SettingsState)