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
| fun ComponentContext.componentCoroutineScope(): CoroutineScope { | |
| val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) | |
| if (lifecycle.state != Lifecycle.State.DESTROYED) { | |
| lifecycle.doOnDestroy { | |
| scope.cancel() | |
| } | |
| } else { | |
| scope.cancel() | |
| } |
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
| fun <T : Any> Value<T>.toStateFlow(lifecycle: Lifecycle): StateFlow<T> { | |
| val state = MutableStateFlow(this.value) | |
| if (lifecycle.state != Lifecycle.State.DESTROYED) { | |
| val observer = { value: T -> state.value = value } | |
| subscribe(observer) | |
| lifecycle.doOnDestroy { | |
| unsubscribe(observer) | |
| } | |
| } |
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 App : Application(), KoinProvider { | |
| override lateinit var koin: Koin | |
| private set | |
| override fun onCreate() { | |
| super.onCreate() | |
| koin = createKoin() | |
| } |
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 ru.mobileup.template.core.utils | |
| import com.arkivanov.decompose.Child | |
| import com.arkivanov.decompose.ComponentContext | |
| import com.arkivanov.decompose.router.stack.ChildStack | |
| import com.arkivanov.decompose.router.stack.StackNavigationSource | |
| import com.arkivanov.decompose.router.stack.childStack | |
| import com.arkivanov.decompose.value.MutableValue | |
| import com.arkivanov.decompose.value.Value | |
| import com.arkivanov.essenty.lifecycle.Lifecycle |
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.example.arcoremask | |
| import com.google.android.filament.Engine | |
| import com.google.android.filament.IndexBuffer | |
| import com.google.android.filament.MaterialInstance | |
| import com.google.android.filament.RenderableManager | |
| import com.google.android.filament.RenderableManager.PrimitiveType | |
| import com.google.android.filament.VertexBuffer | |
| import com.google.android.filament.VertexBuffer.AttributeType | |
| import com.google.android.filament.VertexBuffer.VertexAttribute.POSITION |
OlderNewer