From 66b52e02de4a80a9895baba7cd8652fd823d4b99 Mon Sep 17 00:00:00 2001 From: Mudsir Wazir Date: Sun, 13 Sep 2026 21:47:10 +0500 Subject: [PATCH] fix: Keep Download button visible in changelog sheet (#7284) Co-authored-by: wized2 --- .../ui/preferences/about/ChangesDialog.kt | 120 ++++++++++-------- 1 file changed, 64 insertions(+), 56 deletions(-) diff --git a/lawnchair/src/app/lawnchair/ui/preferences/about/ChangesDialog.kt b/lawnchair/src/app/lawnchair/ui/preferences/about/ChangesDialog.kt index a928f0f095..3a408a0ba3 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/about/ChangesDialog.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/about/ChangesDialog.kt @@ -52,68 +52,76 @@ fun ChangesDialog( sheetState = sheetState, containerColor = MaterialTheme.colorScheme.surface, ) { - Column(modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp)) { - Text( - text = stringResource(R.string.changes_dialog_title), - style = MaterialTheme.typography.headlineSmall, - ) - Text( - text = stringResource( - R.string.changes_dialog_build_format, - currentBuild, - latestBuild, - ), - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - modifier = Modifier.padding(top = 8.dp, bottom = 16.dp), - ) - } - LazyColumn( + Column( modifier = Modifier - .heightIn(max = 600.dp) - .fillMaxWidth(), + .fillMaxWidth() + .heightIn(max = 600.dp), ) { - if (commits != null) { - itemsIndexed(commits) { index, commit -> - PreferenceGroupItem( - cutTop = index != 0, - cutBottom = index != commits.lastIndex, - ) { - CommitItem(commit = commit) + Column( + modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp), + ) { + Text( + text = stringResource(R.string.changes_dialog_title), + style = MaterialTheme.typography.headlineSmall, + ) + Text( + text = stringResource( + R.string.changes_dialog_build_format, + currentBuild, + latestBuild, + ), + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.padding(top = 8.dp, bottom = 16.dp), + ) + } + LazyColumn( + modifier = Modifier + .weight(1f, fill = false) + .fillMaxWidth(), + ) { + if (commits != null) { + itemsIndexed(commits) { index, commit -> + PreferenceGroupItem( + cutTop = index != 0, + cutBottom = index != commits.lastIndex, + ) { + CommitItem(commit = commit) + } + Spacer(Modifier.height(3.dp)) + } + } else { + item { + Text( + text = stringResource(R.string.changes_dialog_error), + color = MaterialTheme.colorScheme.error, + style = MaterialTheme.typography.bodyMedium, + ) } - Spacer(Modifier.height(3.dp)) - } - } else { - item { - Text( - text = stringResource(R.string.changes_dialog_error), - color = MaterialTheme.colorScheme.error, - style = MaterialTheme.typography.bodyMedium, - ) } } - } - Row( - horizontalArrangement = Arrangement.End, - modifier = Modifier - .padding(horizontal = 16.dp, vertical = 8.dp) - .fillMaxWidth(), - ) { - OutlinedButton( - onClick = onDismiss, - shapes = ButtonDefaults.shapes(), + Row( + horizontalArrangement = Arrangement.End, + modifier = Modifier + .padding(horizontal = 16.dp, vertical = 8.dp) + .fillMaxWidth(), ) { - Text(text = stringResource(android.R.string.cancel)) - } - Spacer(Modifier.width(8.dp)) - Button( - onClick = { - onDownload() - onDismiss() - }, - shapes = ButtonDefaults.shapes(), - ) { - Text(text = stringResource(R.string.download_update)) + OutlinedButton( + onClick = onDismiss, + shapes = ButtonDefaults.shapes(), + ) { + Text(text = stringResource(android.R.string.cancel)) + } + Spacer(Modifier.width(8.dp)) + Button( + onClick = { + onDownload() + onDismiss() + }, + shapes = ButtonDefaults.shapes(), + ) { + Text(text = stringResource(R.string.download_update)) + } } } }