public void DisplayRecentSearches(List <RecentSearch> recentSearches) { if (recentSearches != null) { adapter = new RecentSearchAdapter(this, recentSearches); recentSearchList.Adapter = adapter; } }
private void ResultsListItem_Clicked(object sender, AdapterView.ItemClickEventArgs e) { if (showingRecentSearches) { RecentSearchAdapter adapter = (RecentSearchAdapter)resultsList.Adapter; RecentSearch item = adapter.GetItem(e.Position); RecentSearchSelected(this, new RecentSearchSelectedEventArgs(item)); } else { AmbiguousLocationsAdapter adapter = (AmbiguousLocationsAdapter)resultsList.Adapter; Location item = adapter.GetItem(e.Position); LocationSelected(this, new LocationSelectedEventArgs(item)); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var app = (PropertyFinderApplication)Application; app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyFinderPersistentState state = stateService.LoadState(); SetContentView(Resource.Layout.PropertyFinderView); searchText = (EditText)FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; myLocationButton = (Button)FindViewById(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button)FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView)FindViewById(Resource.Id.mainview_message); recentSearchList = (ListView)FindViewById(Resource.Id.recentsearches_list); recentSearchList.ItemClick += RecentSearchItem_Clicked; adapter = new RecentSearchAdapter(this, new List <RecentSearch>()); recentSearchList.Adapter = adapter; presenter = new PropertyFinderPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
public void DisplayRecentSearches(List<RecentSearch> recentSearches) { if(recentSearches != null) { adapter = new RecentSearchAdapter(this, recentSearches); recentSearchList.Adapter = adapter; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); var app = (PropertyFinderApplication)Application; app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyFinderPersistentState state = stateService.LoadState(); SetContentView (Resource.Layout.PropertyFinderView); searchText = (EditText) FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; myLocationButton = (Button) FindViewById(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button) FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView) FindViewById(Resource.Id.mainview_message); recentSearchList = (ListView) FindViewById(Resource.Id.recentsearches_list); recentSearchList.ItemClick += RecentSearchItem_Clicked; adapter = new RecentSearchAdapter(this, new List<RecentSearch>()); recentSearchList.Adapter = adapter; presenter = new PropertyFinderPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }