X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/FreeShisen/blobdiff_plain/92b19250a620252d642c0abaf8dd3d733c299f3d..d8d223b49ecc41f4d2d64fa5dcb96709c46f5cb4:/src/de/cwde/freeshisen/ShisenShoActivity.java diff --git a/src/de/cwde/freeshisen/ShisenShoActivity.java b/src/de/cwde/freeshisen/ShisenShoActivity.java index 0478d07..0134ad7 100644 --- a/src/de/cwde/freeshisen/ShisenShoActivity.java +++ b/src/de/cwde/freeshisen/ShisenShoActivity.java @@ -2,6 +2,7 @@ package de.cwde.freeshisen; import android.app.Activity; import android.app.AlertDialog; +import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; @@ -28,8 +29,6 @@ public class ShisenShoActivity extends Activity { PreferenceManager.setDefaultValues(this, R.xml.preferences, false); requestWindowFeature(Window.FEATURE_NO_TITLE); - //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - // WindowManager.LayoutParams.FLAG_FULLSCREEN); view = ShisenSho.app().getView(); ShisenSho.app().activity = this; @@ -75,8 +74,11 @@ public class ShisenShoActivity extends Activity { case R.id.undo: case R.id.clean: return view.onOptionsItemSelected(item); + case R.id.hiscore: + startActivity(new Intent("de.cwde.freeshisen.HISCORE", null)); + return true; case R.id.options: - startActivityForResult(new Intent("de.cwde.freeshisen.SETTINGS", null), 0); + startActivity(new Intent("de.cwde.freeshisen.SETTINGS", null)); return true; case R.id.about: onAboutActivate(); @@ -91,8 +93,9 @@ public class ShisenShoActivity extends Activity { PackageInfo pInfo; try { pInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_META_DATA); - String aboutTitle = String.format("About %s", getString(R.string.app_name)); - String versionString = String.format("Version: %s", pInfo.versionName); + String appname = getString(R.string.app_name); + String aboutTitle = "About " + appname; + String versionString = appname + " "+ pInfo.versionName; String aboutText = getString(R.string.aboutText); // Set up the TextView @@ -103,7 +106,7 @@ public class ShisenShoActivity extends Activity { // Set some padding message.setPadding(5, 5, 5, 5); // Set up the final string - message.setText(versionString + "\n" + s); + message.setText(versionString + s); // Now linkify the text Linkify.addLinks(message, Linkify.ALL); @@ -111,11 +114,32 @@ public class ShisenShoActivity extends Activity { .setTitle(aboutTitle) .setCancelable(true) .setIcon(R.drawable.icon) - .setPositiveButton(getString(android.R.string.ok), null) + .setPositiveButton(android.R.string.ok, null) .setView(message).create() .show(); } catch (NameNotFoundException e) { e.printStackTrace(); } } + + public void onOptionsChanged() + { + new AlertDialog.Builder(this) + .setTitle("Preferences changed!") // FIXME: hardcoded string + .setCancelable(true) + .setIcon(R.drawable.icon) + .setPositiveButton(android.R.string.yes, + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + // User clicked OK button - reset game + view.reset(); + } + }) + .setNegativeButton(android.R.string.no, null) + .setMessage("Changes in Preferences will only have an effect if" + + " a new game is started. Abort current game and start" + + " a new one?") // FIXME: hardcoded string + .create() + .show(); + } }