示例#1
0
        List <AView> GetNativeSwipeItems()
        {
            var swipeItems = new List <AView>();

            for (int i = 0; i < _actionView.ChildCount; i++)
            {
                swipeItems.Add(_actionView.GetChildAt(i));
            }

            return(swipeItems);
        }
        void ProcessTouchSwipeItems(APointF point)
        {
            var swipeItems = GetSwipeItemsByDirection();

            if (swipeItems == null || _actionView == null)
            {
                return;
            }

            for (int i = 0; i < _actionView.ChildCount; i++)
            {
                var swipeButton = _actionView.GetChildAt(i);

                var swipeItemX      = swipeButton.Left / _density;
                var swipeItemY      = swipeButton.Top / _density;
                var swipeItemHeight = swipeButton.Height / _density;
                var swipeItemWidth  = swipeButton.Width / _density;


                if (TouchInsideContent(swipeItemX, swipeItemY, swipeItemWidth, swipeItemHeight, point.X, point.Y))
                {
                    var swipeItem = swipeItems[i];

                    ExecuteSwipeItem(swipeItem);

                    if (swipeItems.SwipeBehaviorOnInvoked != SwipeBehaviorOnInvoked.RemainOpen)
                    {
                        ResetSwipe();
                    }

                    break;
                }
            }
        }