diff --git a/app/src/main/java/com/battlelancer/seriesguide/preferences/AboutActivity.kt b/app/src/main/java/com/battlelancer/seriesguide/preferences/AboutActivity.kt index 5cfdc3e527..549e267d25 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/preferences/AboutActivity.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/preferences/AboutActivity.kt @@ -5,9 +5,11 @@ import android.view.MenuItem import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.annotation.StringRes -import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons @@ -20,6 +22,7 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow @@ -55,6 +58,8 @@ class AboutActivity : ComponentActivity() { } } + private val defaultSpacerSize = 16.dp + @Composable fun About( versionString: String, @@ -87,9 +92,22 @@ class AboutActivity : ComponentActivity() { ) }, content = { scaffoldPadding -> - Box(modifier = Modifier.padding(scaffoldPadding)) { + BoxWithConstraints( + modifier = Modifier + .padding(scaffoldPadding) + .fillMaxWidth() + ) { + val scrollAndPadding = Modifier + .verticalScroll(rememberScrollState()) + .padding(defaultSpacerSize) Column( - modifier = Modifier.verticalScroll(rememberScrollState()) + modifier = if (maxWidth < 600.dp) { + scrollAndPadding + } else { + scrollAndPadding + .width(600.dp) + .align(Alignment.Center) + } ) { Text( text = stringResource(id = R.string.app_name),