Ejemplo n.º 1
0
        public override 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.ViewType = mAdapter.GetItemViewType(position);
                CreateMenu(menu);
                PullToRefresharp.Android.Widget.ListView listview = (PullToRefresharp.Android.Widget.ListView)parent;
                SwipeMenuView menuView = new SwipeMenuView(menu, listview);
                menuView.ItemClickListener = this;
                layout = new SwipeMenuLayout(contentView, menuView,
                                             listview.CloseInterpolator,
                                             listview.OpenInterpolator);
                layout.Position = position;
            }
            else
            {
                layout = (SwipeMenuLayout)convertView;
                layout.CloseMenu();
                layout.Position = position;
                View view = mAdapter.GetView(position, layout.ContentView, parent);
            }
            return(layout);
        }
Ejemplo n.º 2
0
 public SwipeMenuLayout(View contentView, SwipeMenuView menuView,
                        IInterpolator closeInterpolator, IInterpolator openInterpolator)
     : base(contentView.Context)
 {
     mCloseInterpolator = closeInterpolator;
     mOpenInterpolator  = openInterpolator;
     ContentView        = contentView;
     MenuView           = menuView;
     MenuView.Layout    = this;
     Init();
 }
Ejemplo n.º 3
0
 public void OnItemClick(SwipeMenuView view, SwipeMenu menu, int index)
 {
     if (onMenuItemClickDelegate != null)
     {
         onMenuItemClickDelegate(view, menu, index);
     }
     if (onMenuItemClickListner != null)
     {
         onMenuItemClickListner.OnMenuItemClick(view.Position,
                                                menu, index);
     }
 }
Ejemplo n.º 4
0
 public SwipeMenuLayout(View contentView, SwipeMenuView menuView)
     : this(contentView, menuView, null, null)
 {
 }