Skip to content

Commit 4e06254

Browse files
authored
Merge pull request #200 from hossain-khan/copilot/fix-home-screen-scrollability
Fix home screen not scrollable on small devices and landscape mode
2 parents 274aeaa + 442f13c commit 4e06254

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/src/main/java/dev/hossain/keepalive/ui/screen/MainScreen.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import androidx.compose.foundation.layout.padding
2020
import androidx.compose.foundation.layout.size
2121
import androidx.compose.foundation.layout.width
2222
import androidx.compose.foundation.layout.wrapContentSize
23+
import androidx.compose.foundation.rememberScrollState
24+
import androidx.compose.foundation.verticalScroll
2325
import androidx.compose.material.icons.Icons
2426
import androidx.compose.material.icons.filled.Check
2527
import androidx.compose.material.icons.filled.Clear
@@ -101,31 +103,31 @@ fun MainLandingScreen(
101103
modifier =
102104
Modifier
103105
.fillMaxSize()
104-
.wrapContentSize(Alignment.Center)
105-
.padding(innerPadding),
106+
.padding(innerPadding)
107+
.verticalScroll(rememberScrollState()),
108+
horizontalAlignment = Alignment.CenterHorizontally,
106109
) {
110+
// Add top spacing for visual balance
111+
Spacer(modifier = Modifier.height(32.dp))
107112
Image(
108113
painter = painterResource(id = R.drawable.baseline_radar_24),
109114
contentDescription = "App Icon",
110115
modifier =
111116
Modifier
112117
.size(64.dp)
113-
.align(Alignment.CenterHorizontally)
114118
.padding(bottom = 16.dp),
115119
)
116120
AppHeading(
117121
title = "Keep Alive",
118122
modifier =
119123
Modifier
120-
.align(Alignment.CenterHorizontally)
121124
.padding(bottom = 8.dp),
122125
)
123126
Text(
124127
text = "App that keeps other apps alive 💓",
125128
style = MaterialTheme.typography.bodyLarge,
126129
modifier =
127130
Modifier
128-
.align(Alignment.CenterHorizontally)
129131
.padding(bottom = 16.dp),
130132
)
131133

0 commit comments

Comments
 (0)