void OnLongClick(ListItemEventArgs lia) { if (ItemClick != null) ItemLongClick(this, lia); }
void OnItemClick(object sender, ListItemEventArgs args) { AlertDialog.Builder builder = new AlertDialog.Builder(this, Resource.Style.AlertDialogStyle); View dialogView = LayoutInflater.Inflate(Resource.Layout.NumberAlertItem, null); EditText Amount = dialogView.FindViewById<EditText> (Resource.Id.EditAmount); Amount.FocusChange += delegate { if(Amount.HasFocus) Amount.Text = ""; }; var tempItem = _adapter.Items[args.Position]; builder.SetTitle("Enter the amount of your payment"); builder.SetPositiveButton("Send", (senderAlert, e) => { Aflossen(tempItem.Name, System.Convert.ToDouble(Amount.Text)); }); builder.SetNeutralButton("Cancel", (senderAlert, e) => { // yay cancel }); builder.SetView(dialogView); builder.SetCancelable(true); builder.Show(); }
private static void ShowPopupMenu(object sender, ListItemEventArgs args, RecyclerView rv, ContactFragment cf) { ListItemAdapter adapter = (ListItemAdapter) sender; adapter.SelectedItem = adapter.Items[args.Position]; PopupMenu menu = new PopupMenu(cf.Activity, rv.FindViewHolderForAdapterPosition(args.Position).ItemView); menu.Menu.Add(0, 0, 0, "Remove this contact"); menu.SetOnMenuItemClickListener(cf); menu.SetOnDismissListener(cf); menu.Show(); }
private static void ShowPopupMenu(object sender, ListItemEventArgs args, RecyclerView rv, AddContactsScherm acs) { ListItemAdapter adapter = (ListItemAdapter) sender; adapter.SelectedItem = adapter.Items[args.Position]; PopupMenu menu = new PopupMenu(acs, rv.FindViewHolderForAdapterPosition(args.Position).ItemView); menu.Menu.Add(0, 0, 0, "Add this user"); menu.SetOnMenuItemClickListener(acs); menu.SetOnDismissListener(acs); menu.Show(); }