Skip to content
Browse files

instructiontab

  • Loading branch information...
1 parent b105466 commit 1d359c8a002213a12f66706f9aaea6518d2605ae @dua-dua dua-dua committed
View
6 GoldMine/AndroidManifest.xml
@@ -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"
View
8 GoldMine/res/drawable-hdpi/goldminetab.xml
@@ -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>
View
8 GoldMine/res/drawable-hdpi/puregoldtab.xml
@@ -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>
View
17 GoldMine/res/layout/goldmineinstructions_layout.xml
@@ -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>
View
25 GoldMine/res/layout/instructions.xml
@@ -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>
View
17 GoldMine/res/layout/puregoldinstructions_layout.xml
@@ -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>
View
13 GoldMine/src/no/ntnu/tdt4240/activities/GoldMineInstructionActivity.java
@@ -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);
+ }
+
+}
View
30 GoldMine/src/no/ntnu/tdt4240/activities/InstructionsActivity.java
@@ -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);
+
+ }
}
View
13 GoldMine/src/no/ntnu/tdt4240/activities/PureGoldInstructionActivity.java
@@ -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.
Something went wrong with that request. Please try again.