Untitled
unknown
plain_text
9 days ago
2.9 kB
4
Indexable
var showForm by remember { mutableStateOf(false) } var showFilterForm by remember { mutableStateOf(false) } IconButton( onClick = { showForm = true showFilterForm = false }, modifier = Modifier .align(Alignment.CenterEnd) .padding(end = 16.dp, bottom = 280.dp) ) { Image( painter = painterResource(R.mipmap.ic_edit), contentDescription = "Edit Form" ) } if (showForm) { EditForm().FormScreen() } IconButton( onClick = { showFilterForm = true showForm = false }, modifier = Modifier .align(Alignment.CenterEnd) .padding(end = 16.dp, bottom = 180.dp) ) { Image( painter = painterResource(R.mipmap.ic_filter), contentDescription = "Filter Form" ) } if (showFilterForm) { val nodeConnections: Map<String, List<String>> = HashMap() FilterForm().FilterScreen(nodeConnections) } @Composable fun ExpandableTableSection( headerLabels: List<String>, rowValues: List<List<String>>, modifier: Modifier = Modifier ) { var expanded by remember { mutableStateOf(true) } Column( modifier = modifier .fillMaxSize() .padding(top = 16.dp, bottom = 16.dp), verticalArrangement = Arrangement.Bottom, horizontalAlignment = Alignment.CenterHorizontally ) { // Arrow Button (Always above the table) IconButton( onClick = { expanded = !expanded }, modifier = Modifier.background(Color.Transparent) ) { Icon( painter = painterResource( id = if (expanded) R.drawable.expand_uparrow else R.drawable.expand_downarrow ), contentDescription = if (expanded) "Collapse" else "Expand", tint = Color.Unspecified ) } Spacer(modifier = Modifier.height(8.dp)) if (expanded) { TableLayout(headerLabels = headerLabels, rowValues = rowValues) } } }
Editor is loading...
Leave a Comment