mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
support full localization
This commit is contained in:
3 files changed
+43
-19
No files matched your search
@@ -73,11 +73,11 @@ fun MainScreen(gdInstalled: Boolean = true) {
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.geode_logo),
|
||||
contentDescription = "Geode Logo",
|
||||
contentDescription = context.getString(R.string.launcher_logo_alt),
|
||||
modifier = Modifier.size(136.dp, 136.dp)
|
||||
)
|
||||
Text(
|
||||
"Geode",
|
||||
context.getString(R.string.launcher_title),
|
||||
fontSize = 32.sp,
|
||||
modifier = Modifier.padding(12.dp)
|
||||
)
|
||||
@@ -106,34 +106,34 @@ fun MainScreen(gdInstalled: Boolean = true) {
|
||||
}
|
||||
|
||||
Row {
|
||||
Button(onClick = { onLaunch(context) }, enabled = gdInstalled) {
|
||||
Button(onClick = { onLaunch(context) }) {
|
||||
Icon(
|
||||
Icons.Filled.PlayArrow,
|
||||
contentDescription = "Play Icon"
|
||||
contentDescription = context.getString(R.string.launcher_launch_icon_alt)
|
||||
)
|
||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||
Text("Launch")
|
||||
Text(context.getString(R.string.launcher_launch))
|
||||
}
|
||||
Spacer(Modifier.size(2.dp))
|
||||
IconButton(onClick = { onSettings(context) }) {
|
||||
Icon(
|
||||
Icons.Filled.Settings,
|
||||
contentDescription = "Settings Icon"
|
||||
contentDescription = context.getString(R.string.launcher_settings_icon_alt)
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Text(
|
||||
"Geometry Dash could not be found.",
|
||||
context.getString(R.string.game_not_found),
|
||||
modifier = Modifier.padding(12.dp)
|
||||
)
|
||||
OutlinedButton(onClick = { onSettings(context) }) {
|
||||
Icon(
|
||||
Icons.Filled.Settings,
|
||||
contentDescription = "Settings Icon"
|
||||
contentDescription = context.getString(R.string.launcher_settings_icon_alt)
|
||||
)
|
||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||
Text("Settings")
|
||||
Text(context.getString(R.string.launcher_settings))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class SettingsActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fun onExportSaveData(context: Context) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
@@ -55,6 +56,7 @@ fun onExportSaveData(context: Context) {
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
*/
|
||||
|
||||
fun onOpenFolder(context: Context) {
|
||||
context.getExternalFilesDir(null)?.let { file ->
|
||||
@@ -62,12 +64,16 @@ fun onOpenFolder(context: Context) {
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
clipboardManager.setPrimaryClip(
|
||||
ClipData.newPlainText(
|
||||
"Launcher External Folder",
|
||||
context.getString(R.string.export_folder_tag),
|
||||
file.path
|
||||
)
|
||||
)
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
|
||||
Toast.makeText(context, "Copied!", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.export_folder_copied),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,13 +90,13 @@ fun SettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
IconButton(onClick = { onBackPressedDispatcher?.onBackPressed() }) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.ArrowBack,
|
||||
contentDescription = "Back"
|
||||
contentDescription = context.getString(R.string.settings_back_icon_alt)
|
||||
)
|
||||
}
|
||||
},
|
||||
title = {
|
||||
Text(
|
||||
"Settings",
|
||||
context.getString(R.string.title_activity_settings),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
@@ -119,12 +125,14 @@ fun SettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
onClick = { onOpenFolder(context) }
|
||||
)
|
||||
}
|
||||
/*
|
||||
OptionsGroup("Data") {
|
||||
OptionsButton(
|
||||
title = "Export save data",
|
||||
onClick = { onExportSaveData(context) }
|
||||
)
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -236,7 +244,7 @@ fun OptionsCardPreview() {
|
||||
)
|
||||
SettingsCard(
|
||||
title = "Testing option 2",
|
||||
preferenceId = R.string.preference_load_testing
|
||||
preferenceId = R.string.preference_load_automatically
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
<resources>
|
||||
<string name="app_name">Geode</string>
|
||||
<string name="title_activity_geometry_dash">GeometryDash</string>
|
||||
<string name="failed_mod_core">Failed to load mod core.</string>
|
||||
<string name="no_activity_found">No activity found for this action.</string>
|
||||
|
||||
<!-- MainActivity strings -->
|
||||
<string name="game_not_found">Geometry Dash was not found.</string>
|
||||
<string name="launcher_launch">Launch</string>
|
||||
<string name="launcher_settings">Settings</string>
|
||||
<string name="launcher_title">Geode</string>
|
||||
<string name="launcher_logo_alt">geode logo</string>
|
||||
<string name="launcher_launch_icon_alt">play icon</string>
|
||||
<string name="launcher_settings_icon_alt">settings icon</string>
|
||||
<plurals name="automatically_load_countdown">
|
||||
<item quantity="one">Automatically launching game in %1$d second.</item>
|
||||
<item quantity="other">Automatically launching game in %1$d seconds.</item>
|
||||
</plurals>
|
||||
|
||||
<!-- Preference keys -->
|
||||
<string name="preference_file_key">GeodeLauncherPreferencesFileKey</string>
|
||||
<string name="preference_category_testing">General</string>
|
||||
<string name="preference_load_testing">PreferenceLoadTesting</string>
|
||||
<string name="preference_load_testing_name">Load files from /test</string>
|
||||
<string name="preference_load_automatically">PreferenceLoadAutomatically</string>
|
||||
|
||||
<!-- SettingsActivity strings -->
|
||||
<string name="title_activity_settings">Settings</string>
|
||||
<string name="settings_back_icon_alt">back arrow icon</string>
|
||||
|
||||
<string name="export_folder_tag">Launcher External Folder</string>
|
||||
<string name="export_folder_copied">Copied!</string>
|
||||
|
||||
<string name="preference_category_testing">General</string>
|
||||
<string name="preference_load_testing_name">Load files from /test</string>
|
||||
<string name="preference_load_automatically_name">Automatically launch</string>
|
||||
<string name="preference_load_automatically_description">Launches the game after a short delay.</string>
|
||||
<string name="preferences_copy_external_button">Copy external files directory</string>
|
||||
<string name="title_activity_settings">SettingsActivity</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user