remove some hardcoded strings
authorgitknilch <gitknilch@cwde.de>
Sat, 6 Apr 2013 19:39:31 +0000 (21:39 +0200)
committergitknilch <gitknilch@cwde.de>
Sat, 6 Apr 2013 19:39:31 +0000 (21:39 +0200)
Change-Id: Ib77caf338d57d0d1763535b8f45567f768dc1c38
Signed-off-by: gitknilch <gitknilch@cwde.de>
res/values/strings.xml
src/de/cwde/freeshisen/ShisenShoActivity.java
src/de/cwde/freeshisen/ShisenShoView.java

index 2bca4a5004fb4f5180d6883164500666e03e68a6..55dd08733ab0d901ab2bcc493cf86e495e353804 100644 (file)
@@ -41,5 +41,9 @@ Get the source code: https://code.google.com/p/freeshisen/</string>
     <string name="invalidtime">9:99:99</string>
     <string name="clearhiscore_confirm_title">Really clear best times?</string>
     <string name="clearhiscore_confirm_text">This will clear all saved times. Hit &quot;OK&quot; if you really want to do this.</string>
+    <string name="prefchange_confirm_title">Preferences changed!</string>
+    <string name="prefchange_confirm_text">Changes in Preferences will only have an effect if a new game is started. Abort current game and start a new one?</string>
+    <string name="hiscore_title">Hiscore!</string>
+    <string name="hiscore_text">You\'ve made the highscore list!</string>
 
 </resources>
\ No newline at end of file
index 0134ad7c29b7e5c1c5d0e65f1d748dc094b70295..483c6f1f57b7c7b172c5407ad4c1762a9ec72669 100644 (file)
@@ -125,7 +125,7 @@ public class ShisenShoActivity extends Activity {
        public void onOptionsChanged()
        {
                new AlertDialog.Builder(this)
-               .setTitle("Preferences changed!") // FIXME: hardcoded string
+               .setTitle(R.string.prefchange_confirm_title)
                .setCancelable(true)
                .setIcon(R.drawable.icon)
                .setPositiveButton(android.R.string.yes,
@@ -136,10 +136,8 @@ public class ShisenShoActivity extends Activity {
                        }
                })
                .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();
+               .setMessage(R.string.prefchange_confirm_text)
+               .create()
+               .show();
        }
 }
index bf4ad9f507866ef7d791239aa686f005128ac086..6a38ffc4201e061773333fa10e4909979b82f265 100644 (file)
@@ -549,11 +549,12 @@ class ShisenShoView extends SurfaceView implements SurfaceHolder.Callback {
                if (time.compareTo(besttime2) < 0) {
                        // score!
                        new AlertDialog.Builder(app.activity)
-                               .setTitle("Hiscore!")
+                               .setTitle(R.string.hiscore_title)
                                .setCancelable(true)
                                .setIcon(R.drawable.icon)
-                               .setPositiveButton(app.getString(android.R.string.ok), null)
-                               .setMessage("You've made the highscore list!").create() // FIXME: hardcoded string
+                               .setPositiveButton(android.R.string.ok, null)
+                               .setMessage(R.string.hiscore_text)
+                               .create()
                                .show();
 
                        SharedPreferences.Editor editor = sp.edit();
Impressum, Datenschutz