From 6061dbae40790e0f136391bc596761231395f2ca Mon Sep 17 00:00:00 2001 From: Michal Zielinski Date: Fri, 10 May 2024 05:59:48 -0700 Subject: [PATCH] Add complex parameter to Compose sample Summary: As per title Reviewed By: LukeDefeo Differential Revision: D57207794 fbshipit-source-id: b7717e43c09e4e0b52ade4b5cf3d104f4b7001f6 --- .../com/facebook/flipper/sample/JetpackComposeActivity.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/sample/src/main/java/com/facebook/flipper/sample/JetpackComposeActivity.kt b/android/sample/src/main/java/com/facebook/flipper/sample/JetpackComposeActivity.kt index 0a8b57941c4..6d588d88ba0 100644 --- a/android/sample/src/main/java/com/facebook/flipper/sample/JetpackComposeActivity.kt +++ b/android/sample/src/main/java/com/facebook/flipper/sample/JetpackComposeActivity.kt @@ -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) } @@ -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)