// >> swipe-actions-sticky-xamarin

        public void OnExecuteFinished(SwipeActionsBehavior.SwipeActionEvent p0)
        {
            // Fired when the swipe-execute procedure has ended, i.e. the item being swiped is at
            // its original position.
            this.leftWidth  = -1;
            this.rightWidth = -1;
        }
Ejemplo n.º 2
0
        public void OnSwipeStarted(SwipeActionsBehavior.SwipeActionEvent swipeActionEvent)
        {
            View swipeView = swipeActionEvent.SwipeView();

            if (this.leftContentSize == -1 || rightContentSize == -1)
            {
                sap.SetSwipeThresholdStart((((ViewGroup)swipeView).GetChildAt(0)).Width);
                sap.SetSwipeThresholdEnd((((ViewGroup)swipeView).GetChildAt(1)).Width);
            }
        }
        public void OnSwipeProgressChanged(SwipeActionsBehavior.SwipeActionEvent swipeActionEvent)
        {
            if (swipeActionEvent.CurrentOffset() > this.leftWidth)
            {
                ViewGroup.LayoutParams lp = this.leftActionView.LayoutParameters;
                lp.Width = swipeActionEvent.CurrentOffset();
                this.leftActionView.LayoutParameters = lp;
            }

            if (swipeActionEvent.CurrentOffset() < -rightWidth)
            {
                ViewGroup.LayoutParams lp = this.rightActionView.LayoutParameters;
                lp.Width = -swipeActionEvent.CurrentOffset();
                this.rightActionView.LayoutParameters = lp;
            }
        }
        public void OnSwipeStarted(SwipeActionsBehavior.SwipeActionEvent swipeActionEvent)
        {
            ViewGroup swipeView = (ViewGroup)swipeActionEvent.SwipeView();

            this.leftActionView  = swipeView.GetChildAt(0);
            this.rightActionView = swipeView.GetChildAt(1);

            if (leftWidth == -1)
            {
                leftWidth = this.leftActionView.Width;
            }

            if (rightWidth == -1)
            {
                rightWidth = this.rightActionView.Width;
            }
        }
        public void OnSwipeProgressChanged(SwipeActionsBehavior.SwipeActionEvent swipeActionEvent)
        {
            if (swipeActionEvent.CurrentOffset() > leftWidth)
            {
                ViewGroup.LayoutParams lp = this.leftActionView.LayoutParameters;
                lp.Width = swipeActionEvent.CurrentOffset();
                this.leftActionView.LayoutParameters = lp;
            }

            if (swipeActionEvent.CurrentOffset() < -rightWidth)
            {
                ViewGroup.LayoutParams lp = this.rightActionView.LayoutParameters;
                lp.Width = -swipeActionEvent.CurrentOffset();
                this.rightActionView.LayoutParameters = lp;
            }

            if (!this.animationApplied)
            {
                if (Math.Abs(swipeActionEvent.CurrentOffset()) > Math.Abs(leftWidth) * 1.5f)
                {
                    if (swipeActionEvent.CurrentOffset() < 0)
                    {
                        this.rightActionView.GetChildAt(0).ClearAnimation();
                        RotateAnimation ra = new RotateAnimation(0, 360, 0.5f, 0.5f);
                        ra.Interpolator = new AccelerateDecelerateInterpolator();
                        ra.Duration     = 200;
                        this.rightActionView.GetChildAt(0).StartAnimation(ra);
                    }
                    else if (swipeActionEvent.CurrentOffset() > 0)
                    {
                        this.leftActionView.GetChildAt(0).ClearAnimation();
                        RotateAnimation ra = new RotateAnimation(0, 360, 0.5f, 0.5f);
                        ra.Interpolator = new AccelerateDecelerateInterpolator();
                        ra.Duration     = 200;
                        this.leftActionView.GetChildAt(0).StartAnimation(ra);
                    }
                    this.animationApplied = true;
                }
            }
        }
 public void OnSwipeStarted(SwipeActionsBehavior.SwipeActionEvent p0)
 {
 }
 public void OnSwipeProgressChanged(SwipeActionsBehavior.SwipeActionEvent p0)
 {
 }
 public void OnSwipeEnded(SwipeActionsBehavior.SwipeActionEvent p0)
 {
 }
 public void OnExecuteFinished(SwipeActionsBehavior.SwipeActionEvent p0)
 {
 }