protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Manage the views SetContentView(Resource.Layout.StockPriceListActivityLayout); _listView = FindViewById <ListView> (Resource.Id.stock_list); // Set up the correct properties on the application var app = ShinobiStockChartApplication.GetApplication(this); app.CurrentActivity = this; // Prepare the services var uiMarshal = new MarshalInvokeService(app); var appStatus = new AppStatusService(app); var navigation = new NavigationService(app); // Create the presenter _presenter = new StockPriceListPresenter(appStatus, uiMarshal, navigation); _presenter.SetView(this); app.Presenter = _presenter; // Set up click handling _listView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var stockItem = _prices [e.Position]; StockSelected(this, new StockSelectedEventArgs(stockItem)); }; // Apply the title ActionBar.Title = _presenter.Title; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var app = PropertyCrossApplication.GetApplication(this); app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((Android.Locations.LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyCrossPersistentState state = stateService.LoadState(); SetContentView(Resource.Layout.PropertyCrossView); searchText = (EditText)FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; searchText.SetOnEditorActionListener(this); 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); resultsHeader = (TextView)FindViewById(Resource.Id.results_header); resultsList = (ListView)FindViewById(Resource.Id.results_list); resultsList.ItemClick += ResultsListItem_Clicked; resultsList.Adapter = new RecentSearchAdapter(this, new List <RecentSearch>()); loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate); loadingAnimation.RepeatMode = RepeatMode.Restart; presenter = new PropertyCrossPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
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 override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); var navController = new UINavigationController(); var marshalInvokeService = new MarshalInvokeService(); var appStatusService = new AppStatusService(); var navigationService = new NavigationService(navController); var stockPriceListPresenter = new StockPriceListPresenter(appStatusService, marshalInvokeService, navigationService); var mainView = new StocksListViewController(stockPriceListPresenter); navController.PushViewController(mainView, false); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); var app = PropertyCrossApplication.GetApplication(this); app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService( (Android.Locations.LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyCrossPersistentState state = stateService.LoadState(); SetContentView (Resource.Layout.PropertyCrossView); searchText = FindViewById<EditText>(Resource.Id.search); searchText.TextChanged += delegate(object sender, Android.Text.TextChangedEventArgs e) { String searchTerm = searchText.Text; if (searchTerm != null) { searchTerm = searchTerm.Trim(); SearchTextChanged(this, new SearchTextChangedEventArgs(searchTerm)); } }; searchText.SetOnEditorActionListener(this); myLocationButton = FindViewById<Button>(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); resultsHeader = (TextView) FindViewById(Resource.Id.results_header); resultsList = (ListView) FindViewById(Resource.Id.results_list); resultsList.ItemClick += ResultsListItem_Clicked; resultsList.Adapter = new RecentSearchAdapter(this, new List<RecentSearch>()); loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate); loadingAnimation.RepeatMode = RepeatMode.Restart; presenter = new PropertyCrossPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
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; }