-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicPreviews.kt
85 lines (77 loc) 路 1.31 KB
/
BasicPreviews.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.kotlindojo.learningpreviews.ui.previews
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.kotlindojo.learningpreviews.TextSample
import com.kotlindojo.learningpreviews.ui.theme.LearningPreviewsTheme
@Preview(group = "Basic")
@Composable
fun BasicPreview() {
LearningPreviewsTheme {
TextSample()
}
}
/**
* Background
*/
@Preview(
group = "Background",
showBackground = true,
backgroundColor = 0xFF03A9F4
)
@Composable
fun ShowBackgroundPreview() {
LearningPreviewsTheme {
TextSample()
}
}
/**
* Width and Height in dp
* Defaults to wrap content
*/
@Preview(
group = "Dimensions",
widthDp = 128,
heightDp = 64
)
@Composable
fun DimensionsPreview() {
LearningPreviewsTheme {
TextSample()
}
}
/**
* Scale font
*/
@Preview(
group = "Font scale",
fontScale = 1.5f
)
@Composable
fun FontScalePreview() {
LearningPreviewsTheme {
TextSample()
}
}
/**
* API Level
*/
@Preview(
group = "API Level",
apiLevel = 33
)
@Composable
fun ApiLevel33Preview() {
LearningPreviewsTheme {
TextSample()
}
}
@Preview(
group = "API Level",
apiLevel = 25
)
@Composable
fun ApiLevel28Preview() {
LearningPreviewsTheme {
TextSample()
}
}