]> cvs.zerfleddert.de Git - FreeShisen/blobdiff - src/de/cwde/shisensho/ShisenShoActivity.java
remove "sample" files, fix classpath.
[FreeShisen] / src / de / cwde / shisensho / ShisenShoActivity.java
index 8ba59afe142a858ebf80fd43d469f323f14e29ed..43753652ac467cce68bedcb815a1fa35aa218908 100644 (file)
@@ -21,26 +21,26 @@ public class ShisenShoActivity extends Activity {
        private ShisenShoView view;
 
        /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        
-        PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
+       @Override
+       public void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+
+               PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
 
-        requestWindowFeature(Window.FEATURE_NO_TITLE);
-        //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
-        //             WindowManager.LayoutParams.FLAG_FULLSCREEN);
+               requestWindowFeature(Window.FEATURE_NO_TITLE);
+               //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+               //              WindowManager.LayoutParams.FLAG_FULLSCREEN);
 
-        view = ShisenSho.app().getView();
-        ShisenSho.app().activity = this;
-        setContentView(view);
-    }
+               view = ShisenSho.app().getView();
+               ShisenSho.app().activity = this;
+               setContentView(view);
+       }
 
        @Override
        protected void onDestroy() {
                ViewGroup vg = (ViewGroup)(view.getParent());
                vg.removeView(view);
-        ShisenSho.app().activity = null;
+               ShisenSho.app().activity = null;
                super.onDestroy();
        }
 
@@ -62,58 +62,58 @@ public class ShisenShoActivity extends Activity {
 
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
-           MenuInflater inflater = getMenuInflater();
-           inflater.inflate(R.menu.menu, menu);
-           return true;
+               MenuInflater inflater = getMenuInflater();
+               inflater.inflate(R.menu.menu, menu);
+               return true;
        }
 
        @Override
        public boolean onOptionsItemSelected(MenuItem item) {
-           // Handle item selection
-           switch (item.getItemId()) {
-           case R.id.hint:
-           case R.id.undo:
-           case R.id.clean:
-               return view.onOptionsItemSelected(item);
-           case R.id.options:
-               startActivityForResult(new Intent("de.cwde.shisensho.SETTINGS", null), 0);
-               return true;
-           case R.id.about:
-               onAboutActivate();
-               return true;
-           default:
-               return super.onOptionsItemSelected(item);
-           }
+               // Handle item selection
+               switch (item.getItemId()) {
+               case R.id.hint:
+               case R.id.undo:
+               case R.id.clean:
+                       return view.onOptionsItemSelected(item);
+               case R.id.options:
+                       startActivityForResult(new Intent("de.cwde.shisensho.SETTINGS", null), 0);
+                       return true;
+               case R.id.about:
+                       onAboutActivate();
+                       return true;
+               default:
+                       return super.onOptionsItemSelected(item);
+               }
        }
 
        private void onAboutActivate() {
-        // Try to load the a package matching the name of our own package
-        PackageInfo pInfo;
+               // Try to load the a package matching the name of our own package
+               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 aboutText = getString(R.string.aboutText);
+                       String aboutTitle = String.format("About %s", getString(R.string.app_name));
+                       String versionString = String.format("Version: %s", pInfo.versionName);
+                       String aboutText = getString(R.string.aboutText);
 
-               // Set up the TextView
-               final TextView message = new TextView(this);
-               // We'll use a spannablestring to be able to make links clickable
-               final SpannableString s = new SpannableString(aboutText);
+                       // Set up the TextView
+                       final TextView message = new TextView(this);
+                       // We'll use a spannablestring to be able to make links clickable
+                       final SpannableString s = new SpannableString(aboutText);
 
-               // Set some padding
-               message.setPadding(5, 5, 5, 5);
-               // Set up the final string
-               message.setText(versionString + "\n" + s);
-               // Now linkify the text
-               Linkify.addLinks(message, Linkify.ALL);
+                       // Set some padding
+                       message.setPadding(5, 5, 5, 5);
+                       // Set up the final string
+                       message.setText(versionString + "\n" + s);
+                       // Now linkify the text
+                       Linkify.addLinks(message, Linkify.ALL);
 
-               new AlertDialog.Builder(this)
-                       .setTitle(aboutTitle)
-                       .setCancelable(true)
-                       .setIcon(R.drawable.icon)
-                       .setPositiveButton(getString(android.R.string.ok), null)
-                       .setView(message).create()
-                       .show();
+                       new AlertDialog.Builder(this)
+                       .setTitle(aboutTitle)
+                       .setCancelable(true)
+                       .setIcon(R.drawable.icon)
+                       .setPositiveButton(getString(android.R.string.ok), null)
+                       .setView(message).create()
+                       .show();
                } catch (NameNotFoundException e) {
                        e.printStackTrace();
                }
Impressum, Datenschutz