Permalink
Browse files

instructiontab

  • Loading branch information...
dua-dua committed Apr 26, 2012
1 parent b105466 commit 1d359c8a002213a12f66706f9aaea6518d2605ae
@@ -34,6 +34,12 @@
android:label="@string/instructions_label"
android:theme="@android:style/Theme.Dialog" >
</activity>
+ <activity
+ android:name=".activities.GoldMineInstructionActivity">
+ </activity>
+ <activity
+ android:name=".activities.PureGoldInstructionActivity">
+ </activity>
<activity
android:name=".activities.AboutActivity"
android:label="@string/about_label"
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:drawable="@drawable/wormsmine"
+ android:state_selected="true" />
+
+ <item android:drawable="@drawable/wormsmine" />
+</selector>
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:drawable="@drawable/gold"
+ android:state_selected="true" />
+
+ <item android:drawable="@drawable/gold" />
+</selector>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <!-- Screen Design -->
+ <TextView android:text="In GoldMine mode your objective is to score as many points as possible by finding and clicking the cells containing gold and avoiding the cells containing mines. The golden number indicates how many adjacent gold cells this cell has. The grey number indicates how many adjacent mines this cell has. Players take turn and the one with the highest score when there is no more gold left is the winner. Every time you click a gold cell you get an extra click. Good luck!"
+
+ android:padding="15dip"
+ android:textSize="18dip"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"/>
+
+</LinearLayout>
@@ -1,8 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:padding="10dip">
- <TextView android:id="@+id/instructions_content"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:text="@string/instructions_text" />
-</ScrollView>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/tabhost"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <TabWidget
+ android:id="@android:id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <FrameLayout
+ android:id="@android:id/tabcontent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"/>
+ </LinearLayout>
+</TabHost>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <!-- Screen Design -->
+ <TextView android:text="In Pure Gold Mode your objective is to score as many points as possible by finding and clicking the cells containing gold. The golden number in each cell indicates how many adjacent gold cells this cell has. Players take turn and the one with the highest score when there is no more gold left is the winner. Every time you find gold you get an extra click. Good luck!"
+
+ android:padding="15dip"
+ android:textSize="18dip"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"/>
+
+</LinearLayout>
@@ -0,0 +1,13 @@
+package no.ntnu.tdt4240.activities;
+
+import android.app.Activity;
+import android.os.Bundle;
+import no.ntnu.tdt4240.R;
+
+public class GoldMineInstructionActivity extends Activity{
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.goldmineinstructions_layout);
+ }
+
+}
@@ -1,14 +1,38 @@
package no.ntnu.tdt4240.activities;
import no.ntnu.tdt4240.R;
-import android.app.Activity;
+import android.app.TabActivity;
+import android.content.Intent;
import android.os.Bundle;
+import android.widget.TabHost;
+import android.widget.TabHost.TabSpec;
-public class InstructionsActivity extends Activity {
+public class InstructionsActivity extends TabActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.instructions);
- }
+
+ TabHost tabHost = getTabHost();
+
+ // Tab for Photos
+ TabSpec puregoldspec = tabHost.newTabSpec("Pure Gold");
+ // setting Title and Icon for the Tab
+ puregoldspec.setIndicator("Pure Gold", getResources().getDrawable(R.drawable.gold));
+ Intent photosIntent = new Intent(this, PureGoldInstructionActivity.class);
+ puregoldspec.setContent(photosIntent);
+
+ // Tab for Songs
+ TabSpec goldminespec = tabHost.newTabSpec("GoldMine");
+ goldminespec.setIndicator("GoldMine", getResources().getDrawable(R.drawable.wormsmine));
+ Intent songsIntent = new Intent(this, GoldMineInstructionActivity.class);
+ goldminespec.setContent(songsIntent);
+
+
+ // Adding all TabSpec to TabHost
+ tabHost.addTab(puregoldspec);
+ tabHost.addTab(goldminespec);
+
+ }
}
@@ -0,0 +1,13 @@
+package no.ntnu.tdt4240.activities;
+
+import android.app.Activity;
+import android.os.Bundle;
+import no.ntnu.tdt4240.R;
+
+public class PureGoldInstructionActivity extends Activity{
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.puregoldinstructions_layout);
+ }
+
+}

0 comments on commit 1d359c8

Please sign in to comment.