mirror of
https://github.com/bspeice/itcs4180
synced 2024-12-04 21:28:10 -05:00
Add a button so that previously found locations can go straight to
results.
This commit is contained in:
parent
dba76dd0a6
commit
8a3870e763
@ -44,6 +44,12 @@
|
|||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnViewResult"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="View Result" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
@ -37,7 +37,7 @@ import android.widget.Toast;
|
|||||||
public class SearchActivity extends Activity {
|
public class SearchActivity extends Activity {
|
||||||
|
|
||||||
ImageView locationImage;
|
ImageView locationImage;
|
||||||
Button compassButton, scanButton;
|
Button compassButton, scanButton, resultButton;
|
||||||
TextView locationText, riddleView;
|
TextView locationText, riddleView;
|
||||||
Intent intent;
|
Intent intent;
|
||||||
RestLocation restLocation;
|
RestLocation restLocation;
|
||||||
@ -52,6 +52,7 @@ public class SearchActivity extends Activity {
|
|||||||
locationImage = (ImageView)findViewById(R.id.locationImage);
|
locationImage = (ImageView)findViewById(R.id.locationImage);
|
||||||
compassButton = (Button)findViewById(R.id.compassButton);
|
compassButton = (Button)findViewById(R.id.compassButton);
|
||||||
scanButton = (Button)findViewById(R.id.scanButton);
|
scanButton = (Button)findViewById(R.id.scanButton);
|
||||||
|
resultButton = (Button)findViewById(R.id.btnViewResult);
|
||||||
riddleView = (TextView)findViewById(R.id.riddleView);
|
riddleView = (TextView)findViewById(R.id.riddleView);
|
||||||
|
|
||||||
restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation"));
|
restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation"));
|
||||||
@ -59,6 +60,9 @@ public class SearchActivity extends Activity {
|
|||||||
|
|
||||||
locationText.setText(restLocation.getName());
|
locationText.setText(restLocation.getName());
|
||||||
riddleView.setText(restLocation.getRiddle());
|
riddleView.setText(restLocation.getRiddle());
|
||||||
|
if (restLocation.getKey() != null) {
|
||||||
|
resultButton.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
scanButton.setOnClickListener(new OnClickListener(){
|
scanButton.setOnClickListener(new OnClickListener(){
|
||||||
|
|
||||||
@ -133,6 +137,15 @@ public class SearchActivity extends Activity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
resultButton.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View arg0) {
|
||||||
|
Intent i = new Intent(SearchActivity.this, FoundActivity.class);
|
||||||
|
i.putExtra("restLocation", restLocation);
|
||||||
|
startActivity(i);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Bitmap locationPicture = BitmapAccess.loadBitmap(this, restLocation.getName());
|
Bitmap locationPicture = BitmapAccess.loadBitmap(this, restLocation.getName());
|
||||||
if(locationPicture != null)
|
if(locationPicture != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user