public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SetupParallax();
            View.UserInteractionEnabled = true;

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
				_stepManager.StartCountingFrom(DateTime.Now);
            }) {Direction = UISwipeGestureRecognizerDirection.Down,});

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
       			 _stepManager.StartCountingFrom(DateTime.Today);
            }) {Direction = UISwipeGestureRecognizerDirection.Up,});

            // Perform any additional setup after loading the view, typically from a nib.
            _progressView = new ProgressView {View = {Frame = View.Frame}};
            progressContainer.AddSubview(_progressView.View);
            _stepManager.DailyStepCountChanged += TodaysStepCountChanged;

            if (CMStepCounter.IsStepCountingAvailable == false)
            {
                var unsupportedDevice = new UnsupportedDevice();
                unsupportedDevice.View.Frame = View.Frame;
                View.Add(unsupportedDevice.View);
            }
            btnDistance.TouchUpInside += ConvertDistance;
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetupParallax();
            View.UserInteractionEnabled = true;

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                var alert = new UIAlertView("Reset step count", "Are you sure you want to reset todays step count?",
                                            null, "Cancel", "OK");
                alert.Show();
                alert.Clicked += delegate(object sender, UIButtonEventArgs args)
                {
                    if (args.ButtonIndex == 1)
                    {
                        _stepManager.StartCountingFrom(DateTime.Now);
                    }
                };
            })
            {
                Direction = UISwipeGestureRecognizerDirection.Down,
            });

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                var alert = new UIAlertView("Steps since midnight?", "Do you want to start counting from Midnight?",
                                            null, "Cancel", "OK");
                alert.Show();
                alert.Clicked += delegate(object sender, UIButtonEventArgs args)
                {
                    if (args.ButtonIndex == 1)
                    {
                        _stepManager.StartCountingFrom(DateTime.Today);
                    }
                };
            })
            {
                Direction = UISwipeGestureRecognizerDirection.Up,
            });

            // Perform any additional setup after loading the view, typically from a nib.
            _progressView = new ProgressView {
                View = { Frame = View.Frame }
            };
            progressContainer.AddSubview(_progressView.View);
            _stepManager.DailyStepCountChanged += TodaysStepCountChanged;

            if (CMStepCounter.IsStepCountingAvailable == false)
            {
                var unsupportedDevice = new UnsupportedDevice();
                unsupportedDevice.View.Frame = View.Frame;
                View.Add(unsupportedDevice.View);
            }
            btnDistance.TouchUpInside += ConvertDistance;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetupParallax();
            View.UserInteractionEnabled = true;

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                var alert = new UIAlertView("Reset step count", "Are you sure you want to reset todays step count?",
                    null, "Cancel", "OK");
                alert.Show();
                alert.Clicked += delegate(object sender, UIButtonEventArgs args)
                {
                    if (args.ButtonIndex == 1)
                        _stepManager.StartCountingFrom(DateTime.Now);
                };
            }) {Direction = UISwipeGestureRecognizerDirection.Down,});

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                var alert = new UIAlertView("Steps since midnight?", "Do you want to start counting from Midnight?",
                    null, "Cancel", "OK");
                alert.Show();
                alert.Clicked += delegate(object sender, UIButtonEventArgs args)
                {
                    if (args.ButtonIndex == 1)
                        _stepManager.StartCountingFrom(DateTime.Today);
                };
            }) {Direction = UISwipeGestureRecognizerDirection.Up,});

            // Perform any additional setup after loading the view, typically from a nib.
            _progressView = new ProgressView {View = {Frame = View.Frame}};
            progressContainer.AddSubview(_progressView.View);
            _stepManager.DailyStepCountChanged += TodaysStepCountChanged;

            if (CMStepCounter.IsStepCountingAvailable == false)
            {
                var unsupportedDevice = new UnsupportedDevice();
                unsupportedDevice.View.Frame = View.Frame;
                View.Add(unsupportedDevice.View);
            }
            btnDistance.TouchUpInside += ConvertDistance;
        }
Пример #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SetupParallax();
            View.UserInteractionEnabled = true;

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                _stepManager.StartCountingFrom(DateTime.Now);
            })
            {
                Direction = UISwipeGestureRecognizerDirection.Down,
            });

            View.AddGestureRecognizer(new UISwipeGestureRecognizer(gesture =>
            {
                _stepManager.StartCountingFrom(DateTime.Today);
            })
            {
                Direction = UISwipeGestureRecognizerDirection.Up,
            });

            // Perform any additional setup after loading the view, typically from a nib.
            _progressView = new ProgressView {
                View = { Frame = View.Frame }
            };
            progressContainer.AddSubview(_progressView.View);
            _stepManager.DailyStepCountChanged += TodaysStepCountChanged;

            if (CMStepCounter.IsStepCountingAvailable == false)
            {
                var unsupportedDevice = new UnsupportedDevice();
                unsupportedDevice.View.Frame = View.Frame;
                View.Add(unsupportedDevice.View);
            }
            btnDistance.TouchUpInside += ConvertDistance;
        }