]> cvs.zerfleddert.de Git - FreeShisen/commitdiff
prepare for adding hiscore.
authorgitknilch <gitknilch@cwde.de>
Sun, 3 Mar 2013 22:43:55 +0000 (23:43 +0100)
committergitknilch <gitknilch@cwde.de>
Sun, 3 Mar 2013 22:43:55 +0000 (23:43 +0100)
unfortunately, this looks like it's going to be a huge load of ugly
copy-and-paste stuff.

Change-Id: I494cb8baa02793986901cf2154ebb77262ad508e
Signed-off-by: gitknilch <gitknilch@cwde.de>
AndroidManifest.xml
res/layout/highscore.xml [new file with mode: 0644]
res/menu/menu.xml
res/values/strings.xml
src/de/cwde/shisensho/HighscoreActivity.java [new file with mode: 0644]

index beed6a5011ed0b6f19de49b46c21e25ddd34a27d..92f9f9447f0c52c8d47233be5a54f140af848414 100644 (file)
@@ -1,28 +1,49 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="de.cwde.shisensho"
-      android:versionCode="3"
-      android:versionName="0.3">
-    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="10"></uses-sdk>
+    package="de.cwde.shisensho"
+    android:versionCode="3"
+    android:versionName="0.3" >
 
+    <uses-sdk
+        android:minSdkVersion="5"
+        android:targetSdkVersion="10" >
+    </uses-sdk>
 
-       <application android:icon="@drawable/icon" android:label="@string/app_name"
-               android:name=".ShisenSho" android:allowBackup="true">
-               <activity android:name=".ShisenShoActivity"
-                       android:screenOrientation="landscape">
-                       <intent-filter>
-                               <action android:name="android.intent.action.MAIN" />
-                               <category android:name="android.intent.category.LAUNCHER" />
-                       </intent-filter>
-               </activity>
-               <activity 
-                   android:name=".SettingsActivity"
-                       android:screenOrientation="landscape">
-                       <intent-filter>
-                               <action android:name="de.cwde.shisensho.SETTINGS"/>
-                               <category android:name="android.intent.category.DEFAULT"></category>
-                       </intent-filter>
-               </activity>
+    <application
+        android:name="de.cwde.shisensho.ShisenSho"
+        android:allowBackup="true"
+        android:icon="@drawable/icon"
+        android:label="@string/app_name" >
+        <activity
+            android:name="de.cwde.shisensho.ShisenShoActivity"
+            android:screenOrientation="landscape" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name="de.cwde.shisensho.SettingsActivity"
+            android:parentActivityName="de.cwde.shisensho.ShisenShoActivity"
+            android:screenOrientation="landscape" >
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="de.cwde.shisensho.ShisenShoActivity" />
+            <intent-filter>
+                <action android:name="de.cwde.shisensho.SETTINGS" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name="de.cwde.shisensho.HighscoreActivity"
+            android:parentActivityName="de.cwde.shisensho.ShisenShoActivity"
+            android:screenOrientation="landscape" >
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="de.cwde.shisensho.ShisenShoActivity" />
+        </activity>
+    </application>
 
-       </application>
 </manifest>
\ No newline at end of file
diff --git a/res/layout/highscore.xml b/res/layout/highscore.xml
new file mode 100644 (file)
index 0000000..02eaba0
--- /dev/null
@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <TextView
+        android:id="@+id/textView1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp"
+        android:text="@string/besttimes"
+        android:textAppearance="?android:attr/textAppearanceLarge" />
+
+    <TextView
+        android:id="@+id/textView2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp"
+        android:text="@string/diff_hard"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_large1" />
+
+        <TextView
+            android:id="@+id/textViewHL1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView11"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewHL2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView6"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_medium1st" />
+
+        <TextView
+            android:id="@+id/textViewHM1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView12"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewHM2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView5"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_small1" />
+
+        <TextView
+            android:id="@+id/textViewHS1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView13"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewHS2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/textView4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp"
+        android:text="@string/diff_easy"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView7"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_large1" />
+
+        <TextView
+            android:id="@+id/textViewEL1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView14"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewEL2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView8"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_medium1st" />
+
+        <TextView
+            android:id="@+id/textViewEM1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView15"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewEM2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="2dp" >
+
+        <TextView
+            android:id="@+id/textView9"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_small1" />
+
+        <TextView
+            android:id="@+id/textViewES1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+
+        <TextView
+            android:id="@+id/textView16"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/hiscore_2nd" />
+
+        <TextView
+            android:id="@+id/textViewES2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/zerotime"
+            android:textIsSelectable="true" />
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/textView10"
+        android:layout_width="wrap_content"
+        android:layout_height="0dip"
+        android:layout_margin="2dp"
+        android:layout_weight="1" />
+
+    <Button
+        android:id="@+id/button1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom|end"
+        android:hint="@string/reset_hiscore_hint"
+        android:onClick="clearHiscore"
+        android:text="@string/reset_hiscore" />
+
+</LinearLayout>
\ No newline at end of file
index 804a1af86fd428bce6b3533c45894e2e37d79271..59e6bc4d2c84e9b87c14a78ed8acc307827110f1 100644 (file)
@@ -1,9 +1,35 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu
-  xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:title="@string/hint" android:id="@+id/hint" android:icon="@android:drawable/ic_menu_directions"></item>
-    <item android:title="@string/undo" android:id="@+id/undo" android:icon="@android:drawable/ic_menu_revert"></item>
-    <item android:title="@string/clean" android:id="@+id/clean" android:icon="@android:drawable/ic_menu_delete"></item>
-    <item android:title="@string/options" android:id="@+id/options" android:icon="@android:drawable/ic_menu_preferences"></item>
-    <item android:title="@string/about" android:id="@+id/about" android:icon="@android:drawable/ic_menu_info_details"></item>
-</menu>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <item
+        android:id="@+id/hint"
+        android:icon="@android:drawable/ic_menu_directions"
+        android:title="@string/hint">
+    </item>
+    <item
+        android:id="@+id/undo"
+        android:icon="@android:drawable/ic_menu_revert"
+        android:title="@string/undo">
+    </item>
+    <item
+        android:id="@+id/clean"
+        android:icon="@android:drawable/ic_menu_delete"
+        android:title="@string/clean">
+    </item>
+    <item
+        android:id="@+id/options"
+        android:icon="@android:drawable/ic_menu_preferences"
+        android:title="@string/options">
+    </item>
+<!-- <item
+        android:id="@+id/hiscore"
+        android:title="@string/besttimes">
+    </item>
+ -->
+    <item
+        android:id="@+id/about"
+        android:icon="@android:drawable/ic_menu_info_details"
+        android:title="@string/about">
+    </item>
+
+</menu>
\ No newline at end of file
index 992b7609ea792742750ecbccf1228bd7d8ebe4e6..323496f1b2484a22492ae4da204c07b5e86f7b20 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+
     <string name="app_name">ShisenSho</string>
     <string name="clean">Clean</string>
     <string name="hint">Hint</string>
@@ -13,8 +14,7 @@ Images taken from kshisen (Shisen Sho 1.5.1), from the package kdegames\n
 &#169; 1997 Mario Weilguni\n
 Distributed under GPL v2:\n
 http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt\n
-Get the source code: TODO
-    </string>
+Get the source code: TODO</string>
     <string name="size">Size</string>
     <string name="difficulty">Difficulty</string>
     <string name="size_default">2</string>
@@ -22,7 +22,18 @@ Get the source code: TODO
     <string name="time_counter">Time Counter</string>
     <string name="gravity">Gravity</string>
     <string name="gravity_pref_on">Gravity is active.</string>
-    <string name="gravity_pref_off">Gravity is disabled</string>
-    <string name="time_pref_on">Time Counter active</string>
-    <string name="time_pref_off">Time Counter disabled</string>
-</resources>
+    <string name="gravity_pref_off">Gravity disabled.</string>
+    <string name="time_pref_on">Time Counter is active.</string>
+    <string name="time_pref_off">Time Counter disabled.</string>
+    <string name="besttimes">Fastest Times</string>
+    <string name="diff_hard">Difficulty: Hard</string>
+    <string name="diff_easy">Difficulty: Easy</string>
+    <string name="reset_hiscore">Clear</string>
+    <string name="reset_hiscore_hint">Clears all saved times</string>
+    <string name="hiscore_large1">"Large: 1st "</string>
+    <string name="hiscore_2nd">", 2nd "</string>
+    <string name="hiscore_medium1st">"Medium: 1st "</string>
+    <string name="hiscore_small1">"Small: 1st "</string>
+    <string name="zerotime">00:00:00</string>
+
+</resources>
\ No newline at end of file
diff --git a/src/de/cwde/shisensho/HighscoreActivity.java b/src/de/cwde/shisensho/HighscoreActivity.java
new file mode 100644 (file)
index 0000000..212b414
--- /dev/null
@@ -0,0 +1,18 @@
+package de.cwde.shisensho;
+
+import android.os.Bundle;
+import android.view.View;
+import android.app.Activity;
+
+public class HighscoreActivity extends Activity {
+
+       @Override
+       protected void onCreate(Bundle savedInstanceState) {
+               super.onCreate(savedInstanceState);
+               setContentView(R.layout.highscore);
+       }
+
+       public void clearHiscore(View view) {
+               // TODO
+       }
+}
Impressum, Datenschutz