Ejemplo n.º 1
0
        private void NextCardHandler()
        {
            if (position < (reviewableVerses.Count - 1))
            {
                position++;
            }
            else
            {
                position = 0;
            }

            var newFront = new FrontView(reviewableVerses [position]);
            var newBack  = new BackView(reviewableVerses [position]);

            if (Side == FlipCardSide.Front)
            {
                UIView.Transition(Front, newFront, 0.5f, UIViewAnimationOptions.TransitionFlipFromRight, null);
                Front = newFront;
                Back  = newBack;
            }
            else
            {
                Side = FlipCardSide.Front;
                UIView.Transition(Back, newFront, 0.5f, UIViewAnimationOptions.TransitionFlipFromLeft, null);
                Front = newFront;
                Back  = newBack;
            }
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.Clear;

            Front = new FrontView(verses[0]);
            View.BackgroundColor = UIColor.FromPatternImage(Images.TableViewBackground);

            Back = new BackView(verses[position]);

            MemorizedImage    = Images.HeartRedButton;
            NotMemorizedImage = Images.HeartGreyButton;

            TapGesture = new UITapGestureRecognizer {
                NumberOfTapsRequired = 1
            };
            TapGesture.AddTarget(TapHandler);

            SwipeUpGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Up
            };
            SwipeUpGesture.AddTarget(FlipCardHandler);

            SwipeDownGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Down,
            };
            SwipeDownGesture.AddTarget(FlipCardHandler);

            SwipeUpTwoFingersGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Up,
                NumberOfTouchesRequired = 2
            };
            SwipeUpTwoFingersGesture.RequireGestureRecognizerToFail(SwipeUpGesture);
            SwipeUpTwoFingersGesture.AddTarget(NextCardHandler);

            SwipeDownTwoFingersGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Down,
                NumberOfTouchesRequired = 2,
            };
            SwipeDownTwoFingersGesture.RequireGestureRecognizerToFail(SwipeDownGesture);
            SwipeDownTwoFingersGesture.AddTarget(NextCardHandler);

            RightSwipeGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Right
            };
            RightSwipeGesture.AddTarget(RightSwipeHandler);

            View.Add(Front);
            View.AddGestureRecognizer(SwipeUpGesture);
            View.AddGestureRecognizer(SwipeDownGesture);
            View.AddGestureRecognizer(SwipeUpTwoFingersGesture);
            View.AddGestureRecognizer(SwipeDownTwoFingersGesture);
            View.AddGestureRecognizer(RightSwipeGesture);
            View.AddGestureRecognizer(TapGesture);
        }
Ejemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.Clear;

            Front = new FrontView(reviewableVerses[0]);
            View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromFile(Images.TableViewBackground));

            Back = new BackView(reviewableVerses[position]);

            MemorizedImage    = UIImage.FromFile(Images.HeartRedButton);
            NotMemorizedImage = UIImage.FromFile(Images.HeartGreyButton);

            TapGesture = new UITapGestureRecognizer {
                NumberOfTapsRequired = 1
            };
            TapGesture.AddTarget(FlipCardHandler);

            SwipeUpGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Up
            };
            SwipeUpGesture.AddTarget(NextCardHandler);

            SwipeDownGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Down,
            };
            SwipeDownGesture.AddTarget(NextCardHandler);

            RightSwipeGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Right
            };
            RightSwipeGesture.AddTarget(RightSwipeHandler);

            HandleProductTourStep6();

            View.Add(Front);
            View.AddGestureRecognizer(SwipeUpGesture);
            View.AddGestureRecognizer(SwipeDownGesture);
            View.AddGestureRecognizer(RightSwipeGesture);
            View.AddGestureRecognizer(TapGesture);
        }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            View.BackgroundColor = UIColor.Clear;

            Front = new FrontView (reviewableVerses[0]);
            View.BackgroundColor = UIColor.FromPatternImage (UIImage.FromFile (Images.TableViewBackground));

            Back = new BackView (reviewableVerses[position]);

            MemorizedImage = UIImage.FromFile (Images.HeartRedButton);
            NotMemorizedImage = UIImage.FromFile (Images.HeartGreyButton);

            TapGesture = new UITapGestureRecognizer {
                NumberOfTapsRequired = 1
            };
            TapGesture.AddTarget (FlipCardHandler);

            SwipeUpGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Up
            };
            SwipeUpGesture.AddTarget (NextCardHandler);

            SwipeDownGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Down,
            };
            SwipeDownGesture.AddTarget (NextCardHandler);

            RightSwipeGesture = new UISwipeGestureRecognizer {
                Direction = UISwipeGestureRecognizerDirection.Right
            };
            RightSwipeGesture.AddTarget (RightSwipeHandler);

            HandleProductTourStep6 ();

            View.Add (Front);
            View.AddGestureRecognizer (SwipeUpGesture);
            View.AddGestureRecognizer (SwipeDownGesture);
            View.AddGestureRecognizer (RightSwipeGesture);
            View.AddGestureRecognizer (TapGesture);
        }
Ejemplo n.º 5
0
        private void NextCardHandler()
        {
            if (position < (reviewableVerses.Count - 1)) {
                position++;
            } else {
                position = 0;
            }

            var newFront = new FrontView (reviewableVerses [position]);
            var newBack = new BackView (reviewableVerses [position]);

            if (Side == FlipCardSide.Front) {
                UIView.Transition (Front, newFront, 0.5f, UIViewAnimationOptions.TransitionFlipFromRight, null);
                Front = newFront;
                Back = newBack;
            } else {
                Side = FlipCardSide.Front;
                UIView.Transition (Back, newFront, 0.5f, UIViewAnimationOptions.TransitionFlipFromLeft, null);
                Front = newFront;
                Back = newBack;
            }
        }