summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/scatours-android-ui/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-27 16:00:22 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-05-27 16:00:22 +0000
commiteaf3aa26d10a577fdcd71df3bf169e614d71e3d9 (patch)
tree6d2ffebfac3742c42d15511e527779b48abb7ead /sandbox/travelsample/scatours-android-ui/src
parente6ec4f01650a91757c094f52057eda954447c055 (diff)
Updating initial android ui based on scatour web ui
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@779216 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample/scatours-android-ui/src')
-rw-r--r--sandbox/travelsample/scatours-android-ui/src/com/scatours/android/TripSearch.java36
1 files changed, 36 insertions, 0 deletions
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 978d97cc59..38492aa36d 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,7 +1,11 @@
package com.scatours.android;
+import java.util.Calendar;
+
import android.app.Activity;
import android.os.Bundle;
+import android.widget.ArrayAdapter;
+import android.widget.AutoCompleteTextView;
public class TripSearch extends Activity {
/** Called when the activity is first created. */
@@ -9,5 +13,37 @@ public class TripSearch extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
+
+
+ ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES);
+
+ AutoCompleteTextView textViewFrom = (AutoCompleteTextView) findViewById(R.id.edit_fromLocation);
+ //ArrayAdapter adapterFrom = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, AIRPORT_CODES);
+ textViewFrom.setAdapter(adapter);
+
+ 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);
+
+ //String currentDate = getCurrentDate();
+ //AutoCompleteTextView textStartDate = (AutoCompleteTextView) findViewById(R.id.date_start);
+ //textStartDate.setText(currentDate.toCharArray(), 0, currentDate.length());
+
+ }
+
+ private String getCurrentDate() {
+ final Calendar c = Calendar.getInstance();
+ int mYear = c.get(Calendar.YEAR);
+ int mMonth = c.get(Calendar.MONTH);
+ int mDay = c.get(Calendar.DAY_OF_MONTH);
+
+ return Integer.toString(mMonth) + "/" + Integer.toString(mDay) + "/" + Integer.toString(mYear);
}
+
+ static final String[] AIRPORT_CODES = new String[] {
+ "LGW - London Gatwick Airport",
+ "FLR - Luigi Ridolfi Airport",
+ "SFO - San Francisco Airport"
+ };
+
} \ No newline at end of file