コード例 #1
0
        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;
        }
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Prepare the view
            SetContentView(Resource.Layout.StockChartActivityLayout);

            // Create and show the progress dialog
            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetTitle("Retrieving Data...");
            _progressDialog.SetMessage("Please wait");
            _progressDialog.SetCancelable(false);
            _progressDialog.Show();

            // Manage the updates of the presenter and application
            var app = ShinobiStockChartApplication.GetApplication(this);

            app.CurrentActivity = this;
            _presenter          = app.Presenter as StockChartPresenter;
            _presenter.SetView(this);

            // Get the chart and configure it
            var chartFrag = FragmentManager.FindFragmentById <ChartFragment> (Resource.Id.chart);

            _chart = chartFrag.ShinobiChart;
            _chart.SetTrialKey("<PUT YOUR TRIAL KEY HERE>");

            _chart.XAxis = new DateTimeAxis();
            _chart.XAxis.EnableGestures();
            _chart.YAxis = new NumberAxis();
            _chart.YAxis.EnableGestures();

            // Set the style
            _chart.Style.BackgroundColor            = Resources.GetColor(Resource.Color.chart_background);
            _chart.Style.CanvasBackgroundColor      = Color.Transparent;
            _chart.Style.PlotAreaBackgroundColor    = Color.Transparent;
            _chart.XAxis.Style.LineColor            = Resources.GetColor(Resource.Color.chart_axis);
            _chart.YAxis.Style.LineColor            = Resources.GetColor(Resource.Color.chart_axis);
            _chart.XAxis.Style.TickStyle.LabelColor = Resources.GetColor(Resource.Color.chart_axis);
            _chart.YAxis.Style.TickStyle.LabelColor = Resources.GetColor(Resource.Color.chart_axis);
            _chart.XAxis.Style.TickStyle.LineColor  = Resources.GetColor(Resource.Color.chart_axis);
            _chart.YAxis.Style.TickStyle.LineColor  = Resources.GetColor(Resource.Color.chart_axis);

            // Set the title
            if (_chartTitle != null)
            {
                FindViewById <TextView> (Resource.Id.symbolTextView).Text = _chartTitle;
            }

            // Enable the home button
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);
            ActionBar.Title = _presenter.Title;
        }
 public MarshalInvokeService(ShinobiStockChartApplication application)
 {
     _application = application;
 }
コード例 #4
0
 public AppStatusService(ShinobiStockChartApplication app)
 {
     _app = app;
 }
 public NavigationService(ShinobiStockChartApplication application)
 {
     _application = application;
 }
コード例 #6
0
 public MarshalInvokeService(ShinobiStockChartApplication application)
 {
     _application = application;
 }
コード例 #7
0
 public NavigationService(ShinobiStockChartApplication application)
 {
     _application = application;
 }
コード例 #8
0
 public AppStatusService(ShinobiStockChartApplication app)
 {
     _app = app;
 }