Skip to content

Commit 34a70a5

Browse files
Merge pull request #78 from square/zachklipp/fix-samples
Fix the samples not being full-size.
2 parents c419bc6 + ec5695e commit 34a70a5

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

samples/src/main/java/com/squareup/sample/hellocompose/App.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ private val viewEnvironment = ViewEnvironment(viewRegistry)
4545
}
4646
}
4747

48-
// This preview is broken in dev10, Compose runtime throws an ArrayIndexOutOfBoundsException.
4948
@Preview(showBackground = true)
5049
@Composable private fun AppPreview() {
5150
App()

samples/src/main/java/com/squareup/sample/hellocompose/HelloBinding.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package com.squareup.sample.hellocompose
1717

1818
import androidx.compose.foundation.Text
1919
import androidx.compose.foundation.clickable
20+
import androidx.compose.foundation.layout.fillMaxSize
2021
import androidx.compose.foundation.layout.wrapContentSize
2122
import androidx.compose.ui.Alignment
2223
import androidx.compose.ui.Modifier
@@ -28,6 +29,7 @@ val HelloBinding = composedViewFactory<Rendering> { rendering, _ ->
2829
rendering.message,
2930
modifier = Modifier
3031
.clickable(onClick = rendering.onClick)
32+
.fillMaxSize()
3133
.wrapContentSize(Alignment.Center)
3234
)
3335
}

samples/src/main/java/com/squareup/sample/hellocomposerendering/HelloRenderingWorkflow.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package com.squareup.sample.hellocomposerendering
1717

1818
import androidx.compose.foundation.Text
1919
import androidx.compose.foundation.clickable
20+
import androidx.compose.foundation.layout.fillMaxSize
2021
import androidx.compose.foundation.layout.wrapContentSize
2122
import androidx.compose.material.MaterialTheme
2223
import androidx.compose.runtime.Composable
@@ -48,6 +49,7 @@ object HelloRenderingWorkflow : ComposeWorkflow<String, Toggle>() {
4849
props,
4950
modifier = Modifier
5051
.clickable(onClick = { outputSink.send(Toggle) })
52+
.fillMaxSize()
5153
.wrapContentSize(Alignment.Center)
5254
)
5355
}

0 commit comments

Comments
 (0)