コード例 #1
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;
        }
コード例 #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;
        }
コード例 #3
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;
        }
コード例 #4
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            if(Settings.OverideDistance == false)
            {
                NSLocale locale = NSLocale.CurrentLocale;
                Settings.DistanceIsMetric = locale.UsesMetricSystem;
            }

            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();
            _progressView.Frame = this.View.Frame;
            this.View.AddSubview(_progressView);
            this.View.SendSubviewToBack(_progressView);
            _stepManager.DailyStepCountChanged += TodaysStepCountChanged;

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

            btnDistance.SetTitleColor(UIColor.White, UIControlState.Normal);
            btnDistance.SetTitleColor(UIColor.White, UIControlState.Selected);
            btnDistance.SetTitleColor(UIColor.White, UIControlState.Highlighted);
            lblDate.Text = DateString;
        }
コード例 #5
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;
        }