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 android.content.res.Configuration | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.border | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.foundation.shape.RoundedCornerShape | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.CompositionLocalProvider | |
import androidx.compose.ui.Alignment |
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
@DslMarker | |
annotation class JSBuilderDsl | |
@DslMarker | |
annotation class JSSetterDsl | |
data class JSObj(val map: MutableMap<String, Any?> = mutableMapOf()) : MutableMap<String, Any?> by map { | |
object Arr { | |
@JSBuilderDsl | |
operator fun get(vararg items: Any?) = items |
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
-assumenosideeffects class kotlin.jvm.internal.Intrinsics { | |
public static void checkNotNull(java.lang.Object); | |
public static void checkNotNull(java.lang.Object, java.lang.String); | |
public static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkNotNullExpressionValue(java.lang.Object, java.lang.String); | |
public static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String); | |
public static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String); | |
public static void checkFieldIsNotNull(java.lang.Object, java.lang.String); | |
public static void checkParameterIsNotNull(java.lang.Object, java.lang.String); |
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 androidx.compose.ui.graphics.Color | |
// Material Color Resources | |
val amber_050 = Color(0xFFfff8e1) // Use with black text | |
val amber_100 = Color(0xFFffecb3) // Use with black text | |
val amber_200 = Color(0xFFffe082) // Use with black text | |
val amber_300 = Color(0xFFffd54f) // Use with black text | |
val amber_400 = Color(0xFFffca28) // Use with black text | |
val amber_500 = Color(0xFFffc107) // Use with black text |
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 android.graphics.Bitmap | |
import android.graphics.Color | |
import androidx.annotation.ColorInt | |
import com.curiouscreature.kotlin.math.Float3 | |
import com.curiouscreature.kotlin.math.Mat3 | |
import com.curiouscreature.kotlin.math.saturate | |
import com.curiouscreature.kotlin.math.transpose | |
import kotlin.math.pow | |
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 android.graphics.Canvas | |
import android.widget.EdgeEffect | |
import androidx.dynamicanimation.animation.SpringAnimation | |
import androidx.dynamicanimation.animation.SpringForce | |
import androidx.recyclerview.widget.RecyclerView | |
/** The magnitude of translation distance while the list is over-scrolled. */ | |
private const val OVERSCROLL_TRANSLATION_MAGNITUDE = 0.2f |
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 android.os.Bundle | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleRegistry | |
import androidx.savedstate.SavedStateRegistry | |
import androidx.savedstate.SavedStateRegistryController | |
import androidx.savedstate.SavedStateRegistryOwner | |
internal class MyLifecycleOwner : SavedStateRegistryOwner { | |
private var mLifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this) | |
private var mSavedStateRegistryController: SavedStateRegistryController = SavedStateRegistryController.create(this) |
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
kotlin { | |
val isIosDevice = getenv("PLATFORM_NAME")?.startsWith("iphoneos") == true | |
val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = if (isIosDevice) ::iosArm64 else ::iosX64 | |
fun iosBuildDir(isDebug: Boolean, isDevice: Boolean): File { | |
return project.buildDir.resolve(buildString { | |
append("bin/ios/") | |
append(if (isDebug) "Debug" else "Release") | |
append("-") | |
append(if (isDevice) "iphoneos" else "iphonesimulator") | |
}) |
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 kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.* | |
private val undefined = Any() | |
internal fun <T> Iterable<Flow<T>>.combineLatest(): Flow<List<T>> = | |
combineLatest { it } | |