Beispiel #1
0
        public override void OnSwiped(
            RecyclerView.ViewHolder viewHolder, int direction)
        {
            // Get the view holder item that was swiped away as a ListEntryViewHolder
            var listEntryViewHolder = (viewHolder as ListEntryViewHolder <T>);

            if (listEntryViewHolder == null)
            {
                return;
            }

            // Delete the item that was swiped away
            adapter.Remove(listEntryViewHolder);
        }
        protected void PopupMenu_ItemClick(
            object sender, PopupMenu.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            // Edit Item
            case Resource.Id.ListPopupMenuEditBtn:
                var intent = new Intent(activity, adapter.EditItemActivity);
                intent.PutExtra("ItemIndex", AdapterPosition);
                activity.StartActivity(intent);
                break;

            // Remove Item
            case Resource.Id.ListPopupMenuRemoveBtn:
                adapter.Remove(this);
                break;
            }
        }