Beispiel #1
0
        public override bool Flick(Point from, Point to, int millisecs, Point startPoint)
        {
            if (GesturesEngine.IsHorizontal(from, to))
            {
                if (this.pivotItems.Count > 1)
                {
                    if (to.X - from.X < 0)
                    {
                        this.CurrentItem = this.pivotItems[this.pivotItems.IndexOf(this.currentItem) + 1];
                    }
                    else
                    {
                        this.currentFromLeft = true;
                        this.CurrentItem     = this.pivotItems.Last();
                    }
                }
                else
                {
                    this.AnimateCurrentReposition();
                }
                return(true);
            }
            else if (this.offsetForPanning != 0)
            {
                this.AnimateCurrentReposition();
            }

            return(base.Flick(from, to, millisecs, startPoint));
        }
Beispiel #2
0
        public override bool Pan(Point from, Point to, bool done, Point startPoint)
        {
            this.offsetForHeaders = 0;
            this.offsetForBody    = 0;
            if (done && this.offsetForPanning != 0)
            {
                this.AnimateCurrentReposition();
            }
            else if (GesturesEngine.IsHorizontal(from, to))
            {
                this.offsetForPanning += (to.X - from.X) / 2;
                this.Update();
                return(true);
            }

            return(base.Pan(from, to, done, startPoint));
        }