From abbbe48b3c11c9cf85c4949726323dc38708cb2e Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 27 May 2009 16:05:26 +0000 Subject: Starting to add logic to search button listeners git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@779219 13f79535-47bb-0310-9956-ffa450edef68 --- .../gen/com/scatours/android/R.java | 2 ++ .../scatours-android-ui/res/values/strings.xml | 2 ++ .../src/com/scatours/android/TripSearch.java | 33 ++++++++++++++++++++++ 3 files changed, 37 insertions(+) (limited to 'sandbox/travelsample') diff --git a/sandbox/travelsample/scatours-android-ui/gen/com/scatours/android/R.java b/sandbox/travelsample/scatours-android-ui/gen/com/scatours/android/R.java index 1e56491c1a..296f8678ff 100644 --- a/sandbox/travelsample/scatours-android-ui/gen/com/scatours/android/R.java +++ b/sandbox/travelsample/scatours-android-ui/gen/com/scatours/android/R.java @@ -27,6 +27,8 @@ public final class R { public static final int test=0x7f030001; } public static final class string { + public static final int alert_cancel=0x7f040003; + public static final int alert_yes=0x7f040002; public static final int app_name=0x7f040000; public static final int title_search=0x7f040001; } diff --git a/sandbox/travelsample/scatours-android-ui/res/values/strings.xml b/sandbox/travelsample/scatours-android-ui/res/values/strings.xml index 0f0ebc5cac..8f1b67bcf0 100644 --- a/sandbox/travelsample/scatours-android-ui/res/values/strings.xml +++ b/sandbox/travelsample/scatours-android-ui/res/values/strings.xml @@ -2,4 +2,6 @@ SCA Tours - Search Trip Search + Yes + Cancel diff --git a/sandbox/travelsample/scatours-android-ui/src/com/scatours/android/TripSearch.java b/sandbox/travelsample/scatours-android-ui/src/com/scatours/android/TripSearch.java index 5e7dcd33e7..04c7c59c0c 100644 --- a/sandbox/travelsample/scatours-android-ui/src/com/scatours/android/TripSearch.java +++ b/sandbox/travelsample/scatours-android-ui/src/com/scatours/android/TripSearch.java @@ -1,9 +1,15 @@ package com.scatours.android; import android.app.Activity; +import android.app.AlertDialog; +import android.content.DialogInterface; import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; +import android.widget.Button; public class TripSearch extends Activity { /** Called when the activity is first created. */ @@ -22,6 +28,33 @@ public class TripSearch extends Activity { AutoCompleteTextView textViewTo = (AutoCompleteTextView) findViewById(R.id.edit_toLocation); //ArrayAdapter adapterTo = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES); textViewTo.setAdapter(adapter); + + + Button closeButton = (Button) this.findViewById(R.id.btnSearch); + closeButton.setOnClickListener( new OnClickListener() { + public void onClick(View v) { + //Search trips here + new AlertDialog.Builder(TripSearch.this) + .setTitle("SCATour") + .setMessage("You're about to search for trips !") + .setIcon(R.drawable.icon) + .setPositiveButton(R.string.alert_yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + }}) + .setNegativeButton(R.string.alert_cancel, new DialogInterface.OnClickListener(){ + public void onClick(DialogInterface dialog, int which) { + + } + }) + .show(); + + + + + } + }); + } static final String[] AIRPORT_CODES = new String[] { -- cgit v1.2.3