further string tweaks

This commit is contained in:
qimiko committed 2024-05-20 01:43:41 -07:00
1 parent 574a4b5c22
commit 545a0d6532
2 files changed
+32 -38

No files matched your search

@@ -427,35 +427,25 @@ fun UpdateCard(releaseViewModel: ReleaseViewModel, modifier: Modifier = Modifier
@Composable @Composable
fun ErrorInfoBody(failureReason: LaunchUtils.LauncherError, modifier: Modifier = Modifier) { fun ErrorInfoBody(failureReason: LaunchUtils.LauncherError, modifier: Modifier = Modifier) {
val headline = when (failureReason) { val headline = when (failureReason) {
LaunchUtils.LauncherError.LINKER_NEEDS_64BIT,
LaunchUtils.LauncherError.LINKER_NEEDS_32BIT -> stringResource(R.string.load_failed_abi_error)
LaunchUtils.LauncherError.LINKER_FAILED -> stringResource(R.string.load_failed_link_error_description) LaunchUtils.LauncherError.LINKER_FAILED -> stringResource(R.string.load_failed_link_error_description)
LaunchUtils.LauncherError.GENERIC -> stringResource(R.string.load_failed_generic_error_description)
LaunchUtils.LauncherError.CRASHED -> stringResource(R.string.load_failed_crashed_description) LaunchUtils.LauncherError.CRASHED -> stringResource(R.string.load_failed_crashed_description)
else -> stringResource(R.string.load_failed_generic_error_description)
} }
val recommendations = when (failureReason) { val recommendations = when (failureReason) {
LaunchUtils.LauncherError.LINKER_NEEDS_64BIT -> listOf(
stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_switch_64bit_abi),
)
LaunchUtils.LauncherError.LINKER_NEEDS_32BIT -> listOf(
stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_switch_32bit_abi),
)
LaunchUtils.LauncherError.LINKER_FAILED -> listOf( LaunchUtils.LauncherError.LINKER_FAILED -> listOf(
stringResource(R.string.load_failed_recommendation_reinstall), stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_update), stringResource(R.string.load_failed_recommendation_update),
) )
LaunchUtils.LauncherError.GENERIC -> listOf(
stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_update),
stringResource(R.string.load_failed_recommendation_report)
)
LaunchUtils.LauncherError.CRASHED -> listOf( LaunchUtils.LauncherError.CRASHED -> listOf(
stringResource(R.string.load_failed_recommendation_safe_mode), stringResource(R.string.load_failed_recommendation_safe_mode),
stringResource(R.string.load_failed_recommendation_report) stringResource(R.string.load_failed_recommendation_report)
) )
else -> listOf(
stringResource(R.string.load_failed_recommendation_reinstall),
stringResource(R.string.load_failed_recommendation_update),
stringResource(R.string.load_failed_recommendation_report)
)
} }
Column(modifier = modifier) { Column(modifier = modifier) {
@@ -651,12 +641,28 @@ fun DownloadRecommendation(needsUniversal: Boolean, modifier: Modifier = Modifie
else else
stringResource(R.string.launcher_download_32bit) stringResource(R.string.launcher_download_32bit)
val promptTitle = stringResource(R.string.load_failed_abi_error)
val reinstallText = stringResource(R.string.load_failed_recommendation_reinstall)
val recommendationText = if (needsUniversal)
stringResource(R.string.load_failed_recommendation_switch_64bit_abi)
else
stringResource(R.string.load_failed_recommendation_switch_32bit_abi)
Column( Column(
modifier = modifier, modifier = modifier,
verticalArrangement = Arrangement.spacedBy( verticalArrangement = Arrangement.spacedBy(
12.dp, alignment = Alignment.CenterVertically 12.dp, alignment = Alignment.CenterVertically
) )
) { ) {
Text(promptTitle)
Text("\u2022\u00A0\u00A0$reinstallText")
if (showDownload) {
GooglePlayBadge()
}
Text("\u2022\u00A0\u00A0$recommendationText")
ClickableText( ClickableText(
text = AnnotatedString(downloadText), text = AnnotatedString(downloadText),
onClick = { onClick = {
@@ -668,12 +674,6 @@ fun DownloadRecommendation(needsUniversal: Boolean, modifier: Modifier = Modifie
textDecoration = TextDecoration.Underline textDecoration = TextDecoration.Underline
), ),
) )
if (showDownload) {
GooglePlayBadge(
modifier = Modifier.align(Alignment.CenterHorizontally)
)
}
} }
} }
@@ -692,15 +692,6 @@ fun ErrorInfoSheet(failureInfo: LoadFailureInfo, onDismiss: () -> Unit) {
Spacer(Modifier.size(16.dp)) Spacer(Modifier.size(16.dp))
ErrorInfoBody(failureInfo.title)
if (failureInfo.description != null && !failureInfo.title.isAbiFailure()) {
ErrorInfoDescription(
failureInfo.description,
modifier = Modifier.padding(vertical = 8.dp)
)
}
if (failureInfo.title.isAbiFailure()) { if (failureInfo.title.isAbiFailure()) {
DownloadRecommendation( DownloadRecommendation(
needsUniversal = failureInfo.title == LaunchUtils.LauncherError.LINKER_NEEDS_64BIT, needsUniversal = failureInfo.title == LaunchUtils.LauncherError.LINKER_NEEDS_64BIT,
@@ -709,6 +700,15 @@ fun ErrorInfoSheet(failureInfo: LoadFailureInfo, onDismiss: () -> Unit) {
.padding(top = 8.dp, bottom = 16.dp) .padding(top = 8.dp, bottom = 16.dp)
) )
} else { } else {
ErrorInfoBody(failureInfo.title)
if (failureInfo.description != null) {
ErrorInfoDescription(
failureInfo.description,
modifier = Modifier.padding(vertical = 8.dp)
)
}
ErrorInfoActions( ErrorInfoActions(
extraDetails = failureInfo.extendedMessage ?: failureInfo.description, extraDetails = failureInfo.extendedMessage ?: failureInfo.description,
modifier = Modifier modifier = Modifier
@@ -884,12 +884,6 @@ fun LaunchBlockedLabel(text: String) {
if (showDownload) { if (showDownload) {
GooglePlayBadge() GooglePlayBadge()
} else {
OutlinedButton(onClick = { onSettings(context) }) {
Icon(Icons.Filled.Settings, contentDescription = null)
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
Text(context.getString(R.string.launcher_settings))
}
} }
} }
} }
+1 -1
View File
@@ -17,7 +17,7 @@
<string name="launcher_settings_icon_alt">settings icon</string> <string name="launcher_settings_icon_alt">settings icon</string>
<string name="launcher_retry_icon_alt">retry icon</string> <string name="launcher_retry_icon_alt">retry icon</string>
<string name="geode_download_title">Geode is not installed.</string> <string name="geode_download_title">Geode is not installed.</string>
<string name="game_outdated">A Geometry Dash update is required.\nYou currently have version %1$s.</string> <string name="game_outdated">A Geometry Dash update is required.\nYou currently have update %1$s.</string>
<string name="geode_download_description">Geode is downloading. Please wait.</string> <string name="geode_download_description">Geode is downloading. Please wait.</string>
<plurals name="automatically_load_countdown"> <plurals name="automatically_load_countdown">
<item quantity="one">Automatically launching game in %1$d second.</item> <item quantity="one">Automatically launching game in %1$d second.</item>