Add Modifier parameter
This commit is contained in:
parent
ce3e554091
commit
67ba304ad2
1 changed files with 11 additions and 3 deletions
|
|
@ -14,18 +14,20 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ShowkaseButton(
|
fun ShowkaseButton(
|
||||||
onClick: () -> Unit,
|
modifier: Modifier = Modifier,
|
||||||
|
onClick: () -> Unit = {},
|
||||||
) {
|
) {
|
||||||
var isShowkaseButtonVisible by remember { mutableStateOf(BuildConfig.DEBUG) }
|
var isShowkaseButtonVisible by remember { mutableStateOf(BuildConfig.DEBUG) }
|
||||||
|
|
||||||
if (isShowkaseButtonVisible) {
|
if (isShowkaseButtonVisible) {
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier
|
modifier = modifier
|
||||||
.padding(top = 32.dp, start = 16.dp),
|
.padding(top = 32.dp),
|
||||||
onClick = onClick
|
onClick = onClick
|
||||||
) {
|
) {
|
||||||
Text(text = "Showkase Browser")
|
Text(text = "Showkase Browser")
|
||||||
|
|
@ -40,3 +42,9 @@ fun ShowkaseButton(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Preview(group = "Buttons", name = "Showkase button")
|
||||||
|
@Composable
|
||||||
|
fun ShowkaseButtonPreview() {
|
||||||
|
ShowkaseButton()
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue