Example #1
0
 public void OnClick(View v)
 {
     if (SwipeItemClickListener != null && SwipeMenuLayout.IsOpen())
     {
         SwipeItemClickListener.OnItemClick(this, mMenu, v.Id);
     }
 }
        public View GetView(int position, View convertView, ViewGroup parent)
        {
            SwipeMenuLayout layout = null;

            if (convertView == null)
            {
                View      contentView = mAdapter.GetView(position, convertView, parent);
                SwipeMenu menu        = new SwipeMenu(mContext);
                menu.SetViewType(GetItemViewType(position));
                CreateMenu(menu);
                SwipeMenuView menuView = new SwipeMenuView(menu, (SwipeMenuListView)parent)
                {
                    SwipeItemClickListener = this
                };
                SwipeMenuListView listView = (SwipeMenuListView)parent;
                layout = new SwipeMenuLayout(contentView, menuView, listView.CloseInterpolator, listView.OpenInterpolator);
                layout.SetPosition(position);
            }
            else
            {
                layout = (SwipeMenuLayout)convertView;
                layout.CloseMenu();
                layout.SetPosition(position);
                View view = mAdapter.GetView(position, layout.ContentView,
                                             parent);
            }
            if (mAdapter is BaseSwipListAdapter)
            {
                bool swipEnable = (((BaseSwipListAdapter)mAdapter).getSwipEnableByPosition(position));
                layout.SwipEnable = swipEnable;
            }
            return(layout);
        }
 public GestureListerner(SwipeMenuLayout swipeMenuLayout)
 {
     this.swipeMenuLayout = swipeMenuLayout;
 }