diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 841b750..891881c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ android:name=".Mhs202210715136" android:exported="false" /> + var isSelected by remember { mutableStateOf(false) } + + Row( + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 4.dp) + .clickable { + isSelected = !isSelected + } + .background( + if (isSelected) MaterialTheme.colorScheme.secondaryContainer + else Color.Transparent, + RoundedCornerShape(8.dp) + ) + .padding(vertical = 12.dp, horizontal = 16.dp) + .animateContentSize(), + horizontalArrangement = Arrangement.SpaceBetween + ) { + Text( + text = no.toString(), + style = MaterialTheme.typography.bodyMedium, + fontSize = 16.sp, + modifier = Modifier.weight(0.2f) + ) + Text( + text = course, + style = MaterialTheme.typography.bodyMedium, + fontSize = 16.sp, + modifier = Modifier.weight(0.6f) + ) + Text( + text = semester.toString(), + style = MaterialTheme.typography.bodyMedium, + fontSize = 16.sp, + modifier = Modifier.weight(0.2f) + ) + } + } + } + } + + // Interactive Back Button with visual feedback + Button( + onClick = { (context as? ComponentActivity)?.finish() }, + modifier = Modifier + .align(Alignment.CenterHorizontally) + .padding(top = 16.dp), + colors = ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.primary, + contentColor = MaterialTheme.colorScheme.onPrimary + ) + ) { + Text(text = "Kembali") + } + } +}