diff --git a/sample-android/src/main/java/com/github/takahirom/roborazzi/sample/FirstFragment.kt b/sample-android/src/main/java/com/github/takahirom/roborazzi/sample/FirstFragment.kt index e7ab0a6d..9efacc71 100644 --- a/sample-android/src/main/java/com/github/takahirom/roborazzi/sample/FirstFragment.kt +++ b/sample-android/src/main/java/com/github/takahirom/roborazzi/sample/FirstFragment.kt @@ -10,7 +10,10 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CornerSize +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -65,39 +68,44 @@ class FirstFragment : Fragment() { @Composable fun SampleComposableFunction() { var count by remember { mutableStateOf(2) } - Column( - Modifier - .testTag("MyColumn") + Surface( + shape = RoundedCornerShape(corner = CornerSize(8.dp)), + color = MaterialTheme.colorScheme.primaryContainer, ) { - Text( - text = "Add", + Column( Modifier - .testTag("AddBoxButton") - .background(Color.Gray) - .clickable { - count++ - } - ) - Text( - text = "Sub", - Modifier - .testTag("SubBoxButton") - .background(Color.Gray, MaterialTheme.shapes.medium) - .clickable { - count-- - } - ) - (0 until count).forEach { index -> - Box( + .testTag("MyColumn") + ) { + Text( + text = "Add", Modifier - .border(1.dp, Color.Gray, MaterialTheme.shapes.small) - .background(Color.Red) - .testTag("child:$index") - .size(32.dp) - ){ - Text( - text = "$index/$count" - ) + .testTag("AddBoxButton") + .background(Color.Gray) + .clickable { + count++ + } + ) + Text( + text = "Sub", + Modifier + .testTag("SubBoxButton") + .background(Color.Gray, MaterialTheme.shapes.medium) + .clickable { + count-- + } + ) + (0 until count).forEach { index -> + Box( + Modifier + .border(1.dp, Color.Gray, MaterialTheme.shapes.small) + .background(Color.Red) + .testTag("child:$index") + .size(32.dp) + ) { + Text( + text = "$index/$count" + ) + } } } }