This file contains 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 |
This file contains 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 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 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 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 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 DownloadNotificationManager(context: Context) : DefaultFetchNotificationManager(context) { | |
// Copied from DefaultFetchNotificationManager to hide Pause button | |
override fun updateNotification(notificationBuilder: NotificationCompat.Builder, | |
downloadNotification: DownloadNotification, | |
context: Context) { | |
val smallIcon = if (downloadNotification.isDownloading) { | |
android.R.drawable.stat_sys_download | |
} else { | |
android.R.drawable.stat_sys_download_done |
This file contains 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 object DelegateAccess { | |
internal val delegate = ThreadLocal<Any?>() | |
internal val delegateRequested = ThreadLocal<Boolean>().apply { set(false) } | |
} | |
internal val <T> KProperty0<T>.delegate: Any? | |
get() { | |
try { | |
DelegateAccess.delegateRequested.set(true) | |
this.get() |
This file contains 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 me.aartikov.storesample | |
import com.dropbox.android.external.store4.* | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.toList | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.runBlocking | |
import org.junit.Assert.assertEquals |
This file contains 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 me.aartikov.packtest | |
import au.com.dius.pact.consumer.ConsumerPactTestMk2 | |
import au.com.dius.pact.consumer.MockServer | |
import au.com.dius.pact.consumer.dsl.PactDslJsonBody | |
import au.com.dius.pact.consumer.dsl.PactDslWithProvider | |
import au.com.dius.pact.model.RequestResponsePact | |
import com.google.gson.Gson | |
import okhttp3.OkHttpClient | |
import okhttp3.Request |
NewerOlder