Skip to content

Commit

Permalink
Add complex parameter to Compose sample
Browse files Browse the repository at this point in the history
Summary: As per title

Reviewed By: LukeDefeo

Differential Revision: D57207794

fbshipit-source-id: b7717e43c09e4e0b52ade4b5cf3d104f4b7001f6
  • Loading branch information
zielinskimz authored and facebook-github-bot committed May 10, 2024
1 parent 95524a7 commit 6061dba
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -41,7 +41,7 @@ import androidx.compose.ui.unit.sp

@Preview
@Composable
fun Counter() {
fun Counter(complexParameter: ComplexParameter) {
var count: Int by remember { mutableIntStateOf(0) }
var openAlertDialog by remember { mutableStateOf(false) }

Expand Down Expand Up @@ -114,6 +114,10 @@ fun AlertDialogExample(
class JetpackComposeActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent { Counter() }
setContent { Counter(ComplexParameter(ComplexParameterChild("Hello"))) }
}
}

class ComplexParameter(val child: ComplexParameterChild)

class ComplexParameterChild(val value: String)

0 comments on commit 6061dba

Please sign in to comment.