generated from mpetuska/template-kmp-library
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMDCFloatingLabel.kt
38 lines (35 loc) · 1.06 KB
/
MDCFloatingLabel.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
package showcases
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import dev.petuska.katalog.runtime.Showcase
import dev.petuska.katalog.runtime.layout.InteractiveShowcase
import dev.petuska.kmdc.floating.label.MDCFloatingLabel
import sandbox.control.BooleanControl
import sandbox.control.TextControl
private class MDCFloatingLabelVM {
var float by mutableStateOf(false)
var required by mutableStateOf(false)
var shake by mutableStateOf(false)
var label by mutableStateOf("My Label")
}
@Composable
@Showcase(id = "MDCFloatingLabel")
fun MDCFloatingLabel() = InteractiveShowcase(
viewModel = { MDCFloatingLabelVM() },
controls = {
BooleanControl("Float", ::float)
BooleanControl("Required", ::required)
BooleanControl("Shake", ::shake)
TextControl("Label", label) { label = it }
},
) {
MDCFloatingLabel(
id = "kmdc-showcase-floating-label",
text = label,
float = float,
required = required,
shake = shake,
)
}