private void LoadStats()
        {
            var viewModel = myViewModel.CurrentStatisticViewModel;

            viewModel.SetAttacks();

            var flipperView = viewFlipper.GetChildAt(0);

            plotView         = flipperView.FindViewById <PlotView>(Resource.Id.plotView1);
            statShot         = flipperView.FindViewById <CardView>(Resource.Id.statShot);
            statRebound      = flipperView.FindViewById <CardView>(Resource.Id.statRebound);
            statInterception = flipperView.FindViewById <CardView>(Resource.Id.statInterceptions);
            statShotclock    = flipperView.FindViewById <CardView>(Resource.Id.statShotClock);
            statConcededShot = flipperView.FindViewById <CardView>(Resource.Id.statConcededShot);
            statAttackCount  = flipperView.FindViewById <CardView>(Resource.Id.statAttackCount);

            statShot.FindViewById <TextView>(Resource.Id.headerText).Text = "Doelpunten / schoten";
            statShot.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.GoalCount + " / " + viewModel.ShotCount;
            double percentageGoal = (Convert.ToDouble(viewModel.GoalCount) / viewModel.ShotCount) * 100;

            statShot.FindViewById <TextView>(Resource.Id.statDetailText).Text = string.Format("{0}%", percentageGoal);

            statRebound.FindViewById <TextView>(Resource.Id.headerText).Text = "Aanvallende / verdedigende rebounds";
            statRebound.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.ReboundCount + " / " + viewModel.DevensiveReboundCount;

            statInterception.FindViewById <TextView>(Resource.Id.headerText).Text = "Onderscheppingen / Balverlies";
            statInterception.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.InterceptionCount + " / " + viewModel.TurnoverCount;

            statShotclock.FindViewById <TextView>(Resource.Id.headerText).Text = "Schotklok overschrijding";
            statShotclock.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.ShotClokcOverrideCount.ToString();

            statConcededShot.FindViewById <TextView>(Resource.Id.headerText).Text = "CDoelpunten / schoten tegen";
            statConcededShot.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.ConcededGoalCount + " / " + viewModel.ConcededShotCount;

            statAttackCount.FindViewById <TextView>(Resource.Id.headerText).Text = "Aantal aanvallen";
            statAttackCount.FindViewById <TextView>(Resource.Id.statText).Text   = viewModel.AttackCount.ToString();


            plotView.Model = myViewModel.CurrentStatisticViewModel.PlotModel;
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Flipper);

            //set viewflipper to switch between pages
            flipper = FindViewById <ViewFlipper>(Resource.Id.simpleflipper);
            flipper.SetInAnimation(this, Android.Resource.Animation.FadeIn);
            flipper.SetOutAnimation(this, Android.Resource.Animation.FadeOut);

            //set up layouts actions
            var v = flipper.GetChildAt(0); //starting screen

            v.Touch += delegate
            {
                flipper.DisplayedChild = 1;
            };
            v        = flipper.GetChildAt(1); //welcome screen
            v.Touch += delegate
            {
                flipper.DisplayedChild = 2;
            };
            v        = flipper.GetChildAt(2); //connecting screen
            v.Touch += delegate
            {
                flipper.DisplayedChild = 3;
            };
            v        = flipper.GetChildAt(3); //connecting mobile screen
            v.Touch += delegate
            {
                ShowDrinkNotification();
                ShowWalkNotification();
                flipper.DisplayedChild = 4;
            };
            //for mainmenu screen, all the buttons has to lead somewhere
            v = flipper.GetChildAt(4);
            //fetch the button press animation from resource and set it to all the buttons

            //recycle var button for every button and set actions for them
            var button1 = FindViewById <ImageButton>(Resource.Id.mainmenu_button1_id); //taskbutton

            button1.Click += OnTaskButtonClicked;

            var button2 = FindViewById <ImageButton>(Resource.Id.mainmenu_button2_id); //gearbutton
            //button2.Click += OnTaskButtonClicked;

            var button3 = FindViewById <ImageButton>(Resource.Id.mainmenu_button3_id); //creepyguybutton
            //button3.Click += OnTaskButtonClicked;

            var button4 = FindViewById <ImageButton>(Resource.Id.mainmenu_button4_id); //helpbutton

            button4.Click += OnHelpButtonClicked;

            //in the tasks-screen, we make tasks dynamically based on what kind of- and how many tasks need to be done
            v = flipper.GetChildAt(5);

            var task_storage = FindViewById <LinearLayout>(Resource.Id.task_storage_layout);

            //add taks to the task storgae (Linearlayout)
            task_storage.AddView(CreateTask("jfdslkkkkjndfkjnfd fds ds df kfd hdf hfd f ddhf dfh fh hfd hd hdf hfd hfd hdf hffdh fdh fdhfdfdh dfh fdh fd df fsdeg ewdsf ds ss df sd sd sd sd fe ge  sd d er  werferw f er fer f er f erf er fe f re   r"));
            task_storage.AddView(CreateTask("moj"));

            //init heartrate related stuff
            heartRate       = 0;
            sensorManager   = (SensorManager)GetSystemService(SensorService);
            heartRateSensor = sensorManager.GetDefaultSensor(SensorType.HeartRate);
            sl = new SensorListener(this);

            //create and connect googleapi client
            _client = new GoogleApiClientBuilder(this, this, this).AddApi(WearableClass.Api).Build();
            _client.Connect();
        }