Skip to content

Commit

Permalink
Removed "View on Map" from Queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jalaziz committed Jul 28, 2010
1 parent 9d286f2 commit 719393f
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/edu/ucla/cens/whatsinvasive/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.text.util.Linkify;
Expand All @@ -27,15 +26,13 @@
import android.widget.ImageView;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.TwoLineListItem;
import android.widget.AdapterView.OnItemClickListener;
import edu.ucla.cens.whatsinvasive.data.PhotoDatabase;
import edu.ucla.cens.whatsinvasive.data.PhotoDatabase.PhotoDatabaseRow;
import edu.ucla.cens.whatsinvasive.tools.Media;

public class Queue extends ListActivity implements PhotoDatabase.OnChangeListener {
private final int CONTEXT_SHOW_ON_MAP = 0;
private final int CONTEXT_VIEW = 1;
private final int CONTEXT_EDIT_NOTE = 2;
private final int CONTEXT_REMOVE = 3;
Expand Down Expand Up @@ -82,8 +79,7 @@ public void onCreateContextMenu(ContextMenu menu, View v,
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
TagData data = (TagData) info.targetView.getTag();
if(data != null){
menu.setHeaderTitle(getString(R.string.queue_actions));
menu.add(0, CONTEXT_SHOW_ON_MAP, 0, getString(R.string.queue_show_map));
menu.setHeaderTitle(getString(R.string.queue_actions));
menu.add(0, CONTEXT_VIEW, 1, getString(R.string.queue_view));
if(data.uploaded == null) {
menu.add(0, CONTEXT_EDIT_NOTE, 2, getString(R.string.queue_edit_note));
Expand Down Expand Up @@ -136,25 +132,12 @@ protected void onStop() {
super.onStop();
}

private void showOnMap(String lat, String lon){
if(lat != null && lon != null){
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:"+ lat +","+ lon));
Queue.this.startActivity(intent);
} else {
Toast.makeText(Queue.this, getString(R.string.queue_no_location), Toast.LENGTH_SHORT).show();
}
}

@Override
public boolean onContextItemSelected(MenuItem item) {
AdapterView.AdapterContextMenuInfo menuInfo = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
TagData data = (TagData) menuInfo.targetView.getTag();

switch (item.getItemId()) {
case CONTEXT_SHOW_ON_MAP:
showOnMap(data.lat, data.lon);

break;
case CONTEXT_VIEW:
Intent intent = new Intent(this, ViewTag.class);
intent.putExtra("id", data.id);
Expand Down

0 comments on commit 719393f

Please sign in to comment.