mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Move codeviewer to 0.3.0-build141
This commit is contained in:
@@ -9,7 +9,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
// __LATEST_COMPOSE_RELEASE_VERSION__
|
||||
classpath("org.jetbrains.compose:compose-gradle-plugin:0.3.0-build135")
|
||||
classpath("org.jetbrains.compose:compose-gradle-plugin:0.3.0-build141")
|
||||
classpath("com.android.tools.build:gradle:4.0.1")
|
||||
// __KOTLIN_COMPOSE_VERSION__
|
||||
classpath(kotlin("gradle-plugin", version = "1.4.21"))
|
||||
|
||||
@@ -19,7 +19,7 @@ import androidx.compose.ui.unit.sp
|
||||
fun EditorEmptyView() = Box(Modifier.fillMaxSize()) {
|
||||
Column(Modifier.align(Alignment.Center)) {
|
||||
Icon(
|
||||
Icons.Default.Code.copy(defaultWidth = 48.dp, defaultHeight = 48.dp),
|
||||
Icons.Default.Code,
|
||||
tint = AmbientContentColor.current.copy(alpha = 0.60f),
|
||||
modifier = Modifier.align(Alignment.CenterHorizontally)
|
||||
)
|
||||
|
||||
@@ -9,10 +9,12 @@ fun <T : Any> loadable(load: () -> T): MutableState<T?> {
|
||||
return loadableScoped { load() }
|
||||
}
|
||||
|
||||
private val loadingKey = Any()
|
||||
|
||||
@Composable
|
||||
fun <T : Any> loadableScoped(load: CoroutineScope.() -> T): MutableState<T?> {
|
||||
val state: MutableState<T?> = remember { mutableStateOf(null) }
|
||||
LaunchedTask {
|
||||
LaunchedEffect(loadingKey) {
|
||||
try {
|
||||
state.value = load()
|
||||
} catch (e: CancellationException) {
|
||||
|
||||
Reference in New Issue
Block a user