mirror of
https://github.com/JakeWharton/mosaic.git
synced 2025-11-01 03:43:31 +08:00
Update to Compose alpha11
This commit is contained in:
@ -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 = [
|
||||
|
||||
Submodule compose/upstream updated: 6207afb164...6950aab50f
@ -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++
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user