コード例 #1
0
        public FloatingWidgetExpandedController(FloatingWidgetService service, CarrierSideActiveRouteViewModel viewModel)
        {
            this.service   = service;
            this.viewModel = viewModel;

            this.currentPoint = this.viewModel.Points.Where(x => x.Active).FirstOrDefault();

            var expandedView = service.mFloatingView.FindViewById(Resource.Id.floating_widget_layout_expanded);

            pointIndex      = expandedView.FindViewById <TextView>(Resource.Id.widget_current_index);
            pointTypeHeader = expandedView.FindViewById <TextView>(Resource.Id.widget_point_type);
            pointTypeIcon   = expandedView.FindViewById <ImageView>(Resource.Id.widget_point_type_icon);
            pointAddress    = expandedView.FindViewById <TextView>(Resource.Id.widget_point_address);

            passedTimeText  = expandedView.FindViewById <TextView>(Resource.Id.widget_passed_time_text);
            passedContainer = expandedView.FindViewById <LinearLayout>(Resource.Id.widget_passed_time_container);

            //buttons
            nextPointButton        = expandedView.FindViewById <ImageButton>(Resource.Id.widget_next_point_button);
            nextPointButton.Click += NextPointClick;

            previousPointButton        = expandedView.FindViewById <ImageButton>(Resource.Id.widget_previous_point_button);
            previousPointButton.Click += PreviousPointClick;


            controlButtonsContainer = expandedView.FindViewById <LinearLayout>(Resource.Id.widget_control_buttons_container);

            showAppButton        = expandedView.FindViewById <Button>(Resource.Id.widget_show_app_button);
            showAppButton.Click += ShowAppClick;

            gmapsIntentButton        = expandedView.FindViewById <Button>(Resource.Id.widget_set_gmaps_button);
            gmapsIntentButton.Click += GmapsNavigationClick;
        }
コード例 #2
0
        private void PreviousPointClick(object sender, EventArgs e)
        {
            int index = viewModel.Points.IndexOf(currentPoint);

            if (index == 0)
            {
                return;
            }

            currentPoint = viewModel.Points[index - 1];
            UpdateLayout();
        }
コード例 #3
0
        private void NextPointClick(object sender, EventArgs e)
        {
            int index = viewModel.Points.IndexOf(currentPoint);

            if (index == viewModel.Points.Count - 1)
            {
                return;
            }

            currentPoint = viewModel.Points[index + 1];
            UpdateLayout();
        }
コード例 #4
0
        public void OpenNavigation(object sender, EventArgs e)
        {
            RoutePointActiveListViewModel activePoint = this.ViewModel.Points.FirstOrDefault(x => x.Active);

            if (activePoint == null)
            {
                return;
            }

            this.SetFloatingWidget();

            Intent intent = GmapsIntentsProvider.CreatePointIntent(this.Context, activePoint.Point);

            this.StartActivity(intent);
        }
コード例 #5
0
        private void SetActivePoint()
        {
            //check active point
            var pendingPoints = this.routesService.ActiveRoute.Points.Where(x => !x.PassedTime.HasValue).ToList();

            if (pendingPoints.Count > 0)
            {
                int index = pendingPoints.Min(x => x.Index);

                RoutePointActiveListViewModel point = this.Points.Where(x => x.Point.Index == index).FirstOrDefault();
                point.Active      = true;
                point.ShowDetails = true;
                point.RaiseAllPropertiesChanged();
            }
            else
            {
                this.AllPointsPassed = true;
                RaisePropertyChanged(() => this.AllPointsPassed);
                RaisePropertyChanged(() => this.FinishButtonVisible);
            }
        }