littledot5566 avatar littledot5566 committed ca0e295

*UI tweaks. *ActionBar tweaks.

Comments (0)

Files changed (14)

AndroidManifest.xml

     <uses-permission android:name="android.permission.INTERNET" />
 
     <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
+        android:icon="@drawable/treasure_chest_512"
+        android:label="Local Treasure"
         android:theme="@style/Holo.Theme.Sherlock" >
 
         <!--  -->
 v delete expedition from history.
 * Help/About/Credits button telling users what this app is about, thanks for icons, etc.
 * Expedition statistics. Graph of travelled distance over days, etc.
-* Display treasure in a trophy case.
+v Display treasure in a trophy case.
 * Distance from destination, distance travelled in MapAct.
 * "Displayable" column for Expeditions. Don't delete data. (do last)
 v After completing an Expedition, remove from Active Expedition.
-* Completed Expeditions should not display "Continue Expedition" option.
+v Completed Expeditions should not display "Continue Expedition" option.
+* Back button instead of icon.
+* Different excuses when the log is empty. "Had a cold..." "It was raining..." etc.
Add a comment to this file

res/drawable/treasure_chest_512.png

Added
New image

res/layout/history_act_layout.xml

     android:layout_height="fill_parent"
     android:orientation="vertical" >
 
+    <TextView
+        android:id="@+id/history_tv_empty"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="No Expeditions yet."
+        android:visibility="gone" />
+
     <ListView
         android:id="@+id/history_lv_expeditions"
         android:layout_width="fill_parent"

res/layout/main_act_layout.xml

-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <TextView
-        android:id="@+id/main_tv_info"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" />
-
-    <Button
-        android:id="@+id/main_but_startExpedition"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="onClick"
-        android:text="@string/main_but_startHunt" />
-
-    <Button
-        android:id="@+id/main_but_profile"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="onClick"
-        android:text="View my profile" />
-
-    <Button
-        android:id="@+id/main_but_continue"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="onClick"
-        android:text="Continue expedition" />
-
-    <Button
-        android:id="@+id/main_but_history"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="onClick"
-        android:text="History" />
-
-    <Button
-        android:id="@+id/main_but_chest"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="onClick"
-        android:text="Treasure Chest" />
-
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <TextView
+        android:id="@+id/main_tv_info"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:visibility="gone" />
+
+    <Button
+        android:id="@+id/main_but_startExpedition"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="Start a new treasure expedition!" />
+
+    <Button
+        android:id="@+id/main_but_continue"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="Continue expedition" />
+
+    <Button
+        android:id="@+id/main_but_profile"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="View my profile" />
+
+    <Button
+        android:id="@+id/main_but_history"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="Journal" />
+
+    <Button
+        android:id="@+id/main_but_chest"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="Treasure Chest" />
+
    <Button
+        android:id="@+id/main_but_credits"
+        android:layout_width="fill_parent"
+        android:layout_height="48dp"
+        android:onClick="onClick"
+        android:text="Credits" />
+
 </LinearLayout>

res/values/colors.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <!-- <color name="and_">#</color> -->
+    <color name="and_blue">#33B5E5</color>
+    <color name="and_darkblue">#0099CC</color>
+    <color name="and_purple">#AA66CC</color>
+    <color name="and_darkpurple">#9933CC</color>
+    <color name="and_green">#99CC00</color>
+    <color name="and_darkgreen">#669900</color>
+    <color name="and_orange">#FFBB33</color>
+    <color name="and_darkorange">#FF8800</color>
+    <color name="and_red">#FF4444</color>
+    <color name="and_darkred">#CC0000</color>
+
+</resources>

src/nctuw/littledot/localtreasure/Const.java

 
 public class Const {
 	public static final String PACKAGE = "nctuw.littledot.localtreasure";
-	public static final int THEME = R.style.Theme_Sherlock;
+	public static final int THEME = R.style.Theme_Sherlock_Light_DarkActionBar;
 
 	public static final String BUNDLE_SOURCE = "source";
 	public static final String BUNDLE_EID = "eID";

src/nctuw/littledot/localtreasure/components/ExpeditionActivity.java

 import android.os.Bundle;
 import android.view.View;
 
+import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockMapActivity;
 import com.actionbarsherlock.view.Menu;
+import com.actionbarsherlock.view.MenuItem;
 import com.google.android.maps.GeoPoint;
 import com.google.android.maps.MapController;
 import com.google.android.maps.MapView;
 
 		setContentView(R.layout.map_act_layout);
 
+		ActionBar ab = getSupportActionBar();
+		ab.setDisplayHomeAsUpEnabled(true);
+		ab.setDisplayShowHomeEnabled(false);
+		ab.setTitle("Local Treasure");
+
 		// mLI = (LayoutInflater)
 		// getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 		mLM = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
 	}
 
 	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		return true;
+	public boolean onOptionsItemSelected(MenuItem item) {
+		int id = item.getItemId();
+		if (id == android.R.id.home) {
+			finish();
+			return true;
+		}
+		return super.onOptionsItemSelected(item);
 	}
 
 	@Override

src/nctuw/littledot/localtreasure/components/ExpeditionConfigActivity.java

 import nctuw.littledot.localtreasure.R;
 
 import org.holoeverywhere.app.Activity;
-import org.holoeverywhere.widget.Button;
 import org.holoeverywhere.widget.EditText;
 import org.holoeverywhere.widget.Toast;
 
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
 
+import com.actionbarsherlock.app.ActionBar;
+import com.actionbarsherlock.view.MenuItem;
+
 public class ExpeditionConfigActivity extends Activity {
 	InputMethodManager imm;
 
 		setContentView(R.layout.selectdistance_act_layout);
 
 		imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+		ActionBar ab = getSupportActionBar();
+		ab.setDisplayHomeAsUpEnabled(true);
+		ab.setDisplayShowHomeEnabled(false);
+		ab.setTitle("Set your distance");
+
+	}
+
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		int id = item.getItemId();
+
+		if (id == android.R.id.home) {
+			finish();
+			return true;
+		}
 
+		return super.onOptionsItemSelected(item);
 	}
 
 	public void onChooseDistance(View v) {

src/nctuw/littledot/localtreasure/components/HistoryActivity.java

 import org.holoeverywhere.app.Dialog;
 import org.holoeverywhere.widget.ListView;
 
+import com.actionbarsherlock.app.ActionBar;
+import com.actionbarsherlock.view.MenuItem;
+
 import android.content.DialogInterface;
 import android.content.DialogInterface.OnClickListener;
 import android.content.Intent;
 		setContentView(R.layout.history_act_layout);
 		lvHistory = (ListView) findViewById(R.id.history_lv_expeditions);
 
+		ActionBar ab = getSupportActionBar();
+		ab.setDisplayHomeAsUpEnabled(true);
+		ab.setDisplayShowHomeEnabled(false);
+		ab.setTitle("Journal");
+
 		mAdapter = new HistoryActivityAdapter(this);
 		lvHistory.setAdapter(mAdapter);
 		lvHistory.setOnItemClickListener(new OnItemClickListener() {
 	}
 
 	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		int id = item.getItemId();
+		if (id == android.R.id.home) {
+			finish();
+			return true;
+		}
+		return super.onOptionsItemSelected(item);
+	}
+
+	@Override
 	protected void onResume() {
 		super.onResume();
 	}

src/nctuw/littledot/localtreasure/components/MainActivity.java

 import android.widget.Button;
 import android.widget.TextView;
 
+import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.view.Menu;
 
 public class MainActivity extends Activity {
 		mSPManager = new SPManager(this);
 		mDB = new Database(this).open(Database.MODE_WRITE);
 
+		ActionBar ab = getSupportActionBar();
+		ab.setTitle("Main Menu");
+
 	}
 
 	@Override

src/nctuw/littledot/localtreasure/components/ProfileActivity.java

 
 import com.actionbarsherlock.app.ActionBar.Tab;
 import com.actionbarsherlock.app.ActionBar.TabListener;
+import com.actionbarsherlock.app.ActionBar;
 import com.actionbarsherlock.app.SherlockActivity;
 import com.actionbarsherlock.view.Menu;
 import com.actionbarsherlock.view.MenuItem;
 		tvTimeTotal = (TextView) findViewById(R.id.profile_tv_totalTime);
 		gvTreasure = (GridView) findViewById(R.id.profile_gv_treasure);
 
+		ActionBar ab = getSupportActionBar();
+		ab.setDisplayHomeAsUpEnabled(true);
+		ab.setDisplayShowHomeEnabled(false);
+		ab.setTitle("Explorer Profile");
+
 		Bundle bundle = getIntent().getExtras();
 		mProfile = bundle.getParcelable(Const.BUNDLE_PROFILE);
 		Leg.a(mProfile.toString());
 	public boolean onOptionsItemSelected(MenuItem item) {
 		int id = item.getItemId();
 
-		if (id == EDIT) {
+		if (id == android.R.id.home) {
+			finish();
+			return true;
+
+		} else if (id == EDIT) {
 			tvName.setVisibility(View.GONE);
 			etName.setVisibility(View.VISIBLE);
 			etName.setText(tvName.getText());
 			menu.findItem(EDIT).setVisible(false);
 			menu.findItem(SAVE).setVisible(true);
 
+			return true;
+
 		} else if (id == SAVE) {
 			etName.setVisibility(View.GONE);
 			tvName.setVisibility(View.VISIBLE);
 			menu.findItem(EDIT).setVisible(true);
 			menu.findItem(SAVE).setVisible(false);
 
+			return true;
+
 		}
 
 		return super.onOptionsItemSelected(item);

src/nctuw/littledot/localtreasure/components/TreasureActivity.java

 import org.holoeverywhere.app.Activity;
 import org.holoeverywhere.widget.ListView;
 
+import com.actionbarsherlock.app.ActionBar;
+import com.actionbarsherlock.view.MenuItem;
+
 import android.os.Bundle;
 
 public class TreasureActivity extends Activity {
 		setContentView(R.layout.treasure_act);
 		gvTreasure = (ListView) findViewById(R.id.chest_lv_frame);
 
+		ActionBar ab = getSupportActionBar();
+		ab.setDisplayHomeAsUpEnabled(true);
+		ab.setDisplayShowHomeEnabled(false);
+		ab.setTitle("Treasure Chest");
+
 		mAdapter = new TreasureActivityAdapter(this);
 		gvTreasure.setAdapter(mAdapter);
 	}
 
 	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		int id = item.getItemId();
+		if (id == android.R.id.home) {
+			finish();
+			return true;
+		}
+		return super.onOptionsItemSelected(item);
+	}
+
+	@Override
 	protected void onResume() {
 		super.onResume();
 	}

src/nctuw/littledot/localtreasure/database/Treasure.java

 		}
 		throw new IllegalArgumentException("Treasure ID does not exist.");
 	}
-
-	/**************************/
-	/** Interface Parcelable **/
-	/**************************/
-
-	// public int describeContents() {
-	// return 0;
-	// }
-	//
-	// public void writeToParcel(Parcel dest, int flags) {
-	// dest.writeInt(mID);
-	// }
-	//
-	// public static final Parcelable.Creator<Treasure> CREATOR = new
-	// Parcelable.Creator<Treasure>() {
-	// public Treasure createFromParcel(Parcel in) {
-	// return getTreasure(in.readInt());
-	// }
-	//
-	// public Treasure[] newArray(
-	// int size) {
-	// return new Treasure[size];
-	// }
-	// };
-
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.