From 52d0342d17a0834b976c5f9dec365355472c9ab9 Mon Sep 17 00:00:00 2001 From: Uli Bubenheimer Date: Sat, 28 Oct 2023 04:12:18 -0400 Subject: [PATCH] chore: make example main activity scrollable to access all buttons on small screen (#433) --- .../java/com/google/maps/android/compose/MainActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/google/maps/android/compose/MainActivity.kt b/app/src/main/java/com/google/maps/android/compose/MainActivity.kt index f6f8ada0..0b5037db 100644 --- a/app/src/main/java/com/google/maps/android/compose/MainActivity.kt +++ b/app/src/main/java/com/google/maps/android/compose/MainActivity.kt @@ -22,6 +22,8 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material.Button import androidx.compose.material.MaterialTheme import androidx.compose.material.Surface @@ -45,7 +47,8 @@ class MainActivity : ComponentActivity() { val context = LocalContext.current Column( Modifier - .fillMaxSize(), + .fillMaxSize() + .verticalScroll(rememberScrollState()), horizontalAlignment = Alignment.CenterHorizontally ) { Spacer(modifier = Modifier.padding(10.dp))