Update to Compose alpha11

This commit is contained in:
Jake Wharton
2021-01-28 22:09:14 -05:00
parent e11ecfb450
commit ae22ca4ea1
5 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
buildscript {
ext.versions = [
'compose': '1.0.0-alpha10',
'kotlin': '1.4.21',
'compose': '1.0.0-alpha11',
'kotlin': '1.4.21-2',
'kotlinxCoroutines': '1.4.1',
]
ext.deps = [

View File

@ -1,7 +1,7 @@
package example
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedTask
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
@ -125,7 +125,7 @@ private fun Summary(tests: SnapshotStateList<Test>) {
}
var elapsed by remember { mutableStateOf(0) }
LaunchedTask {
LaunchedEffect(Unit) {
while (true) {
delay(1_000)
elapsed++

View File

@ -1,6 +1,6 @@
buildscript {
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21-2'
classpath "com.jakewharton.mosaic:gradle:${mosaicVersion}"
}
repositories {

View File

@ -1,9 +1,9 @@
package com.jakewharton.mosaic
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ComposeNode
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.runtime.emit
import com.facebook.yoga.YogaFlexDirection
@Composable
@ -13,7 +13,7 @@ fun Text(
background: Color? = null,
style: TextStyle? = null,
) {
emit<TextNode, MosaicNodeApplier>(::TextNode) {
ComposeNode<TextNode, MosaicNodeApplier>(::TextNode) {
set(value) {
this.value = value
}
@ -107,7 +107,7 @@ fun Column(children: @Composable () -> Unit) {
@Composable
private fun Box(flexDirection: YogaFlexDirection, children: @Composable () -> Unit) {
emit<BoxNode, MosaicNodeApplier>(
ComposeNode<BoxNode, MosaicNodeApplier>(
factory = ::BoxNode,
update = {
set(flexDirection) {