Skip to content

Commit 3ce5d42

Browse files
committed
Enable Preview backgrounds in Chapter 1 and 2
1 parent 626e226 commit 3ce5d42

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/chapter1_basics/Tutorial1_2ClickSurfacesAndClicks.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import androidx.compose.ui.unit.sp
2626
import com.smarttoolfactory.tutorial1_1basics.ui.components.StyleableTutorialText
2727
import com.smarttoolfactory.tutorial1_1basics.ui.components.TutorialHeader
2828

29-
@Preview
29+
@Preview(showBackground = true)
3030
@Composable
3131
fun Tutorial1_2Screen() {
3232
TutorialContent()
@@ -358,9 +358,9 @@ fun SurfaceClickPropagationExample() {
358358
}
359359
}
360360

361-
@Preview
361+
@Preview(showBackground = true)
362362
@Preview("dark", uiMode = Configuration.UI_MODE_NIGHT_YES)
363-
@Preview(device = Devices.PIXEL_C)
363+
@Preview(device = Devices.PIXEL_C, showBackground = true)
364364
@Composable
365365
private fun Tutorial1_2Preview() {
366366
TutorialContent()

Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/chapter2_material_widgets/MotionLayoutDSLSample.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import androidx.constraintlayout.compose.SwipeMode
1414
import androidx.constraintlayout.compose.SwipeSide
1515
import androidx.constraintlayout.compose.SwipeTouchUp
1616

17-
@Preview
17+
@Preview(showBackground = true)
1818
@Composable
1919
private fun Test() {
2020
MotionLayout(

Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/chapter2_material_widgets/MotionLayoutJSonSample.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import androidx.constraintlayout.compose.MotionLayout
3838
import androidx.constraintlayout.compose.MotionScene
3939
import com.smarttoolfactory.tutorial1_1basics.R
4040

41-
@Preview
41+
@Preview(showBackground = true)
4242
@Composable
4343
fun MotionLayoutSample1() {
4444

@@ -123,7 +123,7 @@ fun MotionLayoutSample1() {
123123
// on below line we are creating
124124
// a motion layout button method.
125125

126-
@Preview
126+
@Preview(showBackground = true)
127127
@Composable
128128
private fun MotionLayoutButtonTest() {
129129
// on below line we are creating a box
@@ -328,7 +328,7 @@ fun MotionLayoutButton() {
328328
}
329329

330330

331-
@Preview(group = "motion8")
331+
@Preview(group = "motion8", showBackground = true)
332332
@Composable
333333
fun AttributesRotationXY() {
334334

Tutorial1-1Basics/src/main/java/com/smarttoolfactory/tutorial1_1basics/chapter2_material_widgets/Tutorial2_10_1BottomSheet.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ private fun MainContentPreview() {
255255

256256
@ExperimentalAnimationApi
257257
@ExperimentalMaterialApi
258-
@Preview
259-
@Preview("dark", uiMode = Configuration.UI_MODE_NIGHT_YES)
260-
@Preview(device = Devices.PIXEL_C)
258+
@Preview(showBackground = true)
259+
@Preview("dark", uiMode = Configuration.UI_MODE_NIGHT_YES, showBackground = true)
260+
@Preview(device = Devices.PIXEL_C, showBackground = true)
261261
@Composable
262262
private fun SheetContentPreview() {
263263
ComposeTutorialsTheme {

0 commit comments

Comments
 (0)