Skip to content

Commit

Permalink
Merge pull request #38405 from ZhilkinSerg/android-2020-02-27
Browse files Browse the repository at this point in the history
Added basic controls help to Android prelaunch menu
  • Loading branch information
kevingranade authored Feb 28, 2020
2 parents 19d6d8f + a64a5b8 commit dfe44a4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Dialog onCreateDialog(int id) {
installDialog = new ProgressDialog(this);
installDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
boolean clean_install = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("installed", "").isEmpty();
installDialog.setTitle(getString(clean_install ? R.string.installing : R.string.upgrading));
installDialog.setTitle(getString(clean_install ? R.string.installTitle : R.string.upgradeTitle));
installDialog.setIndeterminate(true);
installDialog.setCancelable(false);
return installDialog;
Expand Down Expand Up @@ -110,6 +110,7 @@ private class InstallProgramTask extends AsyncTask<Void, Integer, Boolean> {

private AlertDialog installationAlert;
private AlertDialog settingsAlert;
private AlertDialog helpAlert;

@Override
protected void onPreExecute() {
Expand All @@ -133,6 +134,17 @@ public void onClick(DialogInterface dialog, int id) {
installationAlert.show();
}

helpAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle(getString(R.string.helpTitle))
.setCancelable(false)
.setMessage(getString(R.string.helpMessage))
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
settingsAlert.show();
return;
}
}).create();

settingsAlert = new AlertDialog.Builder(SplashScreen.this)
.setTitle("Settings")
.setMultiChoiceItems(SplashScreen.this.mSettingsNames, SplashScreen.this.mSettingsValues, new DialogInterface.OnMultiChoiceClickListener() {
Expand All @@ -148,6 +160,12 @@ public void onClick(DialogInterface dialog, int id) {
SplashScreen.this.startGameActivity(false);
return;
}
})
.setNeutralButton("Show help", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
helpAlert.show();
return;
}
}).create();
}

Expand Down
6 changes: 4 additions & 2 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="installing">Installing game data...</string>
<string name="upgrading">Upgrading game data...</string>
<string name="installTitle">Installing game data...</string>
<string name="upgradeTitle">Upgrading game data...</string>
<string name="helpTitle">Help &amp; Controls</string>
<string name="helpMessage">"Swipe" for directional movement (hold for virtual joystick). "Tap" to confirm selection in menu or Pause one turn in-game (hold to Pause several turns in-game). "Double tap" to cancel or go back in menus (works like Escape key). "Pinch" to zoom in/out (in-game). Use hardware "Back" button to toggle virtual keyboard (hold to toggle keyboard shortcuts).</string>
</resources>

0 comments on commit dfe44a4

Please sign in to comment.