示例#1
0
        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);
        }
示例#2
0
 public virtual void OnItemClick(SwipeMenuView view, SwipeMenu menu, int index)
 {
     if (MenuItemClickListener != null)
     {
         MenuItemClickListener.OnMenuItemClick(view.GetPosition(), menu,
                                               index);
     }
 }
示例#3
0
 public SwipeMenuLayout(View contentView, SwipeMenuView menuView, IInterpolator closeInterpolator, IInterpolator openInterpolator) : base(contentView.Context)
 {
     mCloseInterpolator       = closeInterpolator;
     mOpenInterpolator        = openInterpolator;
     ContentView              = contentView;
     MenuView                 = menuView;
     MenuView.SwipeMenuLayout = this;
     Init();
 }
示例#4
0
 public SwipeMenuLayout(View contentView, SwipeMenuView menuView) : this(contentView, menuView, null, null)
 {
 }