Пример #1
0
        public View GetView(int position, View convertView, ViewGroup parent)
        {
            SwipeMenuLayout layout;

            if (convertView == null)
            {
                View      contentView = Adapter.GetView(position, convertView, parent);
                SwipeMenu menu        = new SwipeMenu(Context);
                menu.ViewType = GetItemViewType(position);
                CreateMenu(menu);
                MenuView            = new SwipeMenuView(menu);
                MenuView.ItemClick += MenuView_ItemClick;
                SwipeMenuListView listView = (SwipeMenuListView)parent;
                layout = new SwipeMenuLayout(contentView, MenuView,
                                             listView.CloseInterpolator,
                                             listView.OpenInterpolator);
                layout.Position = position;
            }
            else
            {
                layout = (SwipeMenuLayout)convertView;
                layout.CloseMenu();
                layout.Position = position;
            }
            if (Adapter is BaseSwipListAdapter adapter)
            {
                var swipEnable = adapter.GetSwipEnableByPosition(position);
                layout.SwipEnable = swipEnable;
            }
            return(layout);
        }
Пример #2
0
 public override void OnItemClick(SwipeMenuView view, SwipeMenu menu, int index)
 {
     Owner.OnMenuItemClick(view.Position, menu, index);
     if (Owner.TouchView != null)
     {
         Owner.TouchView.SmoothCloseMenu();
     }
 }
Пример #3
0
 public virtual void OnItemClick(SwipeMenuView view, SwipeMenu menu, int index)
 {
     MenuItemClick?.Invoke(view.Position, menu, index);
 }
Пример #4
0
 private void MenuView_ItemClick(SwipeMenuView view, SwipeMenu menu, int index)
 {
     OnItemClick(view, menu, index);
 }