private void _noticiaslListView_ItemLogClick(object sender, AdapterView.ItemLongClickEventArgs e) { var id = (int)e.Id; View view = e.View; RelativeLayout rl = view.FindViewById <RelativeLayout>(Resource.Id.ListaDeNoticiaRow_RelativeLayout); if (_selectedNoticias.Select(x => x.Id).Contains(id)) { // deseleciona elemento var colorForUnselected = Resources.GetString(Resource.Color.listitemunselected); rl.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorForUnselected)); _selectedNoticias.Remove(_listaNoticiaAdapter[e.Position]); } else { // seleccionar elemento var colorForSelected = Resources.GetString(Resource.Color.listitemselected); rl.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorForSelected)); _selectedNoticias.Add(_listaNoticiaAdapter[e.Position]); } // forza a android a ejecutar onCreateOptionsMenu Activity.InvalidateOptionsMenu(); }
private void ListView_LongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Are you sure you want to delete this list?"); alert.SetPositiveButton("Yes", async(senderAlert, args) => { DB_Singleton db = DB_Singleton.Instance; //TODO Test this when fixed on the server var response = await new RequestHandler(this).DeleteList(db.Retrieve("Token"), db.GetActiveGroup().GroupID, listoflists[e.Position].Topicid); if ((int)response.StatusCode == 200) { Toast.MakeText(this, "Succesfully Deleted", ToastLength.Long); } else { Toast.MakeText(this, "Error Deleting", ToastLength.Long); } await UpdateLists(); }); alert.SetNegativeButton("No", (senderAlert, args) => { }); Dialog dialog = alert.Create(); dialog.Show(); }
private void ContactList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var itemIndex = e.Position; Int32 contactId = -1; Bitmap thumb = null; bool call = false; bool email = false; bool sms = false; string name = ""; if (GlobalData.ContactsUserItems != null && GlobalData.ContactsUserItems.Count > 0) { contactId = GlobalData.ContactsUserItems[itemIndex].ID; call = GlobalData.ContactsUserItems[itemIndex].ContactEmergencyCall; email = GlobalData.ContactsUserItems[itemIndex].ContactEmergencyEmail; sms = GlobalData.ContactsUserItems[itemIndex].ContactEmergencySms; name = GlobalData.ContactsUserItems[itemIndex].ContactName; thumb = GlobalData.ContactsUserItems[itemIndex].ContactPhoto; } ContactEmergencyStatusDialogFragment contactFragment = new ContactEmergencyStatusDialogFragment(this, contactId, thumb, name, call, email, sms); var fragmentTransaction = FragmentManager.BeginTransaction(); if (fragmentTransaction != null) { Log.Info(TAG, "ContactList_ItemLongClick: Showing dialog Fragment"); contactFragment.Show(fragmentTransaction, contactFragment.Tag); } }
//长按进行删除操作 private void Line_list_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs args) { //弹出消息提示框提示用户确认是否进行删除 var Map = dataService.GetAllMapLines()[args.Position]; try { builder = new AlertDialog.Builder(this); alertDialog = builder .SetTitle("提示") .SetMessage("请确认是否需要删除" + Map.Name + "?") .SetNegativeButton("取消", (s, e) => { }) .SetPositiveButton("删除地图", (s, e) => { //进行删除操作 dataService.DeleteMap(Map); InitRoadMap(); Toast.MakeText(this, "删除成功", ToastLength.Short).Show(); }) .Create(); //创建alertDialog对象 alertDialog.Show(); } catch (Exception ex) { Toast.MakeText(this, "系统异常" + ex.Message, ToastLength.Short).Show(); } }
private void LvFriends_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this.Context); alert.SetTitle("Unfollow user " + Users[e.Position].m_username + " ?"); alert.SetPositiveButton("Confirm", (senderAlert, args) => { DataAccess da = new DataAccess(); if (da.Remove_Friend(m_userID, int.Parse(Users[e.Position].m_id))) { Toast.MakeText(this.Context, "Unfollow successful!", ToastLength.Long).Show(); Users.Remove(Users[e.Position]); lvFriends.Adapter = new UserListAdapter(this.Activity, Users); } else { Toast.MakeText(this.Context, "Unfollow failed!", ToastLength.Long).Show(); } }); alert.SetNegativeButton("Cancel", (senderAlert, args) => {}); Dialog dialog = alert.Create(); dialog.Show(); }
private void OnListViewLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { if (_listVTSModel != null) { ShowConfirmation(_listVTSModel[e.Position]); } }
private void Listview_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { Log.Info("listview", "long click"); Fruit fruit = fruitList[e.Position]; Toast.MakeText(this, fruit.Name, ToastLength.Short).Show(); }
private void Items_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { if (this.DataContext.EnableMultiSelectCommand.CanExecute(this.DataContext.Items[e.Position])) { this.DataContext.EnableMultiSelectCommand.Execute(this.DataContext.Items[e.Position]); } }
private void CarList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder dialog = new AlertDialog.Builder(view.Context); dialog.SetTitle("Potvrda brisanja"); dialog.SetMessage("Jeste li sigurni da želite obrisati označeni automobil?"); dialog.SetPositiveButton("Obriši", (senderAlert, args) => { string selected = carList.GetItemAtPosition(e.Position).ToString(); var firebase = new FirebaseClient(firebaseURL); try { var data = firebase.Child("car").Child(id).Child(selected).DeleteAsync(); con.db.Execute("DELETE from carDetailsSQL WHERE carName = '" + selected + "' "); } catch (Exception) { Toast.MakeText(view.Context, "Something went wrong", ToastLength.Long).Show(); } Toast.MakeText(view.Context, "Automobil '" + selected + "' je uspješno obrisan.", ToastLength.Long).Show(); carsFromDB.Clear(); getCars(); }); dialog.SetNegativeButton("Odustani", (senderAlert, args) => { dialog.Dispose(); }); Dialog alertDialog = dialog.Create(); alertDialog.Show(); }
private void MedicationList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { try { _selectedItemIndex = e.Position; UpdateAdapter(); _medicationList.SetSelection(_selectedItemIndex); var medID = GlobalData.MedicationItems[_selectedItemIndex].ID; Intent intent = new Intent(this, typeof(MedicationMainActivity)); intent.PutExtra("title", "Edit Medication"); intent.PutExtra("isNew", false); intent.PutExtra("medicationID", medID); StartActivityForResult(intent, ConstantsAndTypes.EDIT_MEDICATION_REQUEST); } catch (Exception ex) { Log.Error(TAG, "MedicationList_ItemLongClick: Exception - " + ex.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorMedActivityMedListLongClick), "MedicationActivity.MedicationList_ItemLongClick"); } } }
private void _newsListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { int id = (int)e.Id; View view = e.View; RelativeLayout rl = view.FindViewById <RelativeLayout>(Resource.Id.newsListRow_RelativeLayout); if (_selectedNews.Select(x => x.Id).Contains(id)) { // deselect element var colorForUnselected = Resources.GetString(Resource.Color.listitemunselected); rl.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorForUnselected)); _selectedNews.Remove(_newsListAdapter[e.Position]); } else { // select element var colorForSelected = Resources.GetString(Resource.Color.listitemselected); rl.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorForSelected)); _selectedNews.Add(_newsListAdapter[e.Position]); } // Forces android to execute OnCreateOptionsMenu Activity.InvalidateOptionsMenu(); }
private void List_Category_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { item = list_name_category[e.Position]; var popupMenu = new PopupMenu(this, e.View); try { var fields = popupMenu.Class.GetDeclaredFields(); foreach (Field field in fields) { if ("mPopup".Equals(field.Name)) { field.Accessible = true; Java.Lang.Object menuPopupHelper = field.Get(popupMenu); Method setForceIcons = menuPopupHelper.Class.GetDeclaredMethod("setForceShowIcon", Java.Lang.Boolean.Type); setForceIcons.Invoke(menuPopupHelper, true); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } popupMenu.Inflate(Resource.Layout.menu_itemlistcategoty); popupMenu.Show(); popupMenu.MenuItemClick += PopupMenu_MenuItemClick; }
private void MListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alerta = new AlertDialog.Builder(this); alerta.SetTitle("Deseja Apagar? "); alerta.SetPositiveButton("Sim", (senderAlert, args) => { try { var iten = this.mItens[e.Position]; //mBanco = new CriarBancoProduto(); //mBanco.Db.CreateTable<Produto>(); mBanco.Db.Table <Produto>(); var id = mDados.Where <Produto>(x => x.Id == iten.Id).FirstOrDefault(); //mBanco.Db.CreateTable<Produto>(); mBanco.Db.Delete(id); this.Recreate(); } catch (Exception ex) { Toast.MakeText(this, ex.Message.ToString(), ToastLength.Long).Show(); } }); alerta.SetNegativeButton("Não", (senderAlert, args) => { }); RunOnUiThread(() => { alerta.Show(); }); }
private void Namelist_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { String s1 = data[e.Position].NamePerson; LocalPushNotification(s1); var delete = new AlertDialog.Builder(this); delete.SetMessage("Do you want to delete" + " " + s1); delete.SetNeutralButton("Yes", delegate { DBAdapter db = new DBAdapter(this); db.openDB(); int i = db.Delete(s1); if (i == 1) { Toast.MakeText(this, "Entry Deleted", ToastLength.Short).Show(); adapter.NotifyDataSetChanged(); this.GetNameHouse(); } else { Toast.MakeText(this, "Error! Please Try again", ToastLength.Long).Show(); } }); delete.SetNegativeButton("No", delegate { }); delete.Show(); }
private void AffirmationList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { try { Affirmation affirmationItem = null; AffirmationDialogFragment affirmationFragment = null; Log.Info(TAG, "AffirmationList_ItemLongClick: selected item - " + e.Position.ToString()); affirmationItem = GlobalData.AffirmationListItems[e.Position]; if (affirmationItem != null) { Log.Info(TAG, "AffirmationList_ItemLongClick: Found affirmation with ID - " + affirmationItem.AffirmationID + ", affirmationText - " + affirmationItem.AffirmationText); affirmationFragment = new AffirmationDialogFragment(this, "Edit Affirmation", affirmationItem.AffirmationID); } var fragmentTransaction = FragmentManager.BeginTransaction(); if (fragmentTransaction != null) { affirmationFragment.Show(fragmentTransaction, affirmationFragment.Tag); } } catch (Exception ex) { Log.Error(TAG, "AffirmationList_ItemLongClick: Exception - " + ex.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorAttemptingEditAffirmation), "AffirmationsActivity.AffirmationList_ItemLongClick"); } } }
private void lvlist_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var item = ((AdpAddressList)lvlist.Adapter).GetItemDetail(e.Position); var builder = new AlertDialog.Builder(this); builder.SetTitle("Census"); builder.SetMessage(item.building_no + ", " + item.barangay + ", " + item.city + ", " + item.province); builder.SetPositiveButton("Edit", delegate { var intent = new Intent(); intent.PutExtra("id", item.id.ToString()); intent.SetClass(this, typeof(ActAddressEdit)); StartActivity(intent); }); builder.SetNegativeButton("Delete", delegate { var builderdel = new AlertDialog.Builder(this); builderdel.SetTitle("Census"); builderdel.SetMessage("Are You Sure You Want To Delete Selected Address?\n" + item.building_no + ", " + item.barangay + ", " + item.city + ", " + item.province); builderdel.SetPositiveButton("Delete", delegate { ConAddress.DeleteAddressList(item.id); var builder1 = new AlertDialog.Builder(this); builder1.SetTitle("Census"); builder1.SetTitle("Address Successfully Delete"); builder1.SetPositiveButton("Ok", delegate { refreshItems(); }); builder1.Show(); }); builderdel.SetNegativeButton("Cancel", delegate { builderdel.Dispose(); }); builderdel.Show(); }); builder.Show(); }
private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { string name = (string)this.ListAdapter.GetItem(e.Position); string text = string.Format("Long Clicked on {0}", name); Toast.MakeText(this, text, ToastLength.Short).Show(); }
private void ListTaskOnLongClick(object sender, AdapterView.ItemLongClickEventArgs arg) { LayoutInflater layoutInflater = LayoutInflater.From(this); View promptView = layoutInflater.Inflate(Resource.Layout.TaskMenu, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.SetView(promptView); alertDialogBuilder.SetTitle("Menu"); int item = database.getId(arg.Position); Button verwijder = (Button)promptView.FindViewById <Button>(Resource.Id.buttonMenuDel); Button annuleer = (Button)promptView.FindViewById <Button>(Resource.Id.buttonMenuCancel); AlertDialog alert = alertDialogBuilder.Create(); verwijder.Click += (object senderVerw, System.EventArgs verw) => { database.DeleteFromTable(item); alert.Cancel(); ListView taskList = FindViewById <ListView>(Resource.Id.listView1); List <string> taken = database.getFromTable(datum); ArrayAdapter adapter = new ArrayAdapter <String>(this, Resource.Layout.TextViewItem, taken); taskList.Adapter = adapter; }; annuleer.Click += (object senderVerw, System.EventArgs verw) => { alert.Cancel(); }; alert.Show(); }
private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var menu = new PopupMenu(this, (View)sender); menu.Inflate(Resource.Menu.popupmenu); menu.MenuItemClick += (s, a) => { switch (a.Item.ItemId) { case Resource.Id.review: // update stuff break; case Resource.Id.pm_repport: // update stuff break; } }; menu.Show(); menu.MenuItemClick += Menu_MenuItemClick; var t = TableEmp[e.Position]; Intent = new Intent(this, typeof(ReviewActivity)); Intent.PutExtra("id_emp_review", t.Id.ToString()); Console.WriteLine("safiii hna review "); }
private void ListViewEntrega_ItemLongClick1(object sender, AdapterView.ItemLongClickEventArgs e) { var ListViewEntregaClick = sender as ListView; var t = ListaEntregas[e.Position]; Delete(t); }
private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Czy na pewno chcesz usunąć playlistę " + GlobalMemory._user.Playlists.ToList()[Convert.ToInt32(e.Position)].Name); alert.SetPositiveButton("TAK", async(senderAlert, args) => { progressBar.Visibility = ViewStates.Visible; if (await APIHelper.DeletePlaylist(GlobalMemory._user.Playlists.ToList()[Convert.ToInt32(e.Position)].PlaylistID)) { if (!await APIHelper.GetPlaylists()) { listView.Adapter = null; listView.Visibility = ViewStates.Gone; textView.Visibility = ViewStates.Visible; } else { listView.Adapter = new ArtistsAdapter(this, Resource.Layout.artistsModel, GlobalMemory._user.Playlists.ToList()); } progressBar.Visibility = ViewStates.Gone; Toast.MakeText(this, "Playlista została usunięta", ToastLength.Short); } else { Toast.MakeText(this, "Coś poszło nie tak", ToastLength.Short); progressBar.Visibility = ViewStates.Gone; } }); alert.SetNegativeButton("NIE", (senderAlert, args) => { Toast.MakeText(this, "Anulowano", ToastLength.Long).Show(); }); RunOnUiThread(() => { alert.Show(); }); }
private void GridView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var intent = new Intent(this, typeof(FragmentViewPagerActivity)); intent.PutExtra("image_position", e.Position); StartActivity(intent); }
private void LvSelectedEmps_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.SetMessage("Do you want to remove selected worker from this job?"); alertDialog.SetPositiveButton("Yes", delegate { var selectedEmp = WorkerList[e.Position]; // Delete from Database if (objjob.DeleteEmployeefromJobs(selectedEmp.empID.ToString())) { WorkerList.Remove(selectedEmp); lvSelectedEmps.Adapter = new SelectEmpAdapter(this, WorkerList); Toast.MakeText(this, "Employee removed from the Job", ToastLength.Long).Show(); } else { Toast.MakeText(this, "Something went wrong !!! Can't remove the employee , try the website", ToastLength.Long).Show(); } alertDialog.Dispose(); }); alertDialog.SetNegativeButton("Cancel", delegate { alertDialog.Dispose(); }); alertDialog.Show(); }
//--------------------------------------------------------------------------------------------------------------------------------------------------- //Showing product information. private void ListForChoosingProducts_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { //Creating a new layout for showing information about product. AlertDialog.Builder Object = new AlertDialog.Builder(this); LayoutInflater inflater = LayoutInflater.From(this); LinearLayout layout = new LinearLayout(this); View product_Info = inflater.Inflate(Resource.Layout.product_Info, layout); Object.SetView(product_Info); //Elements from the layout. TextView NameText = product_Info.FindViewById <TextView>(Resource.Id.NameText); TextView ProteinsText = product_Info.FindViewById <TextView>(Resource.Id.ProteinsText); TextView FatsText = product_Info.FindViewById <TextView>(Resource.Id.FatsText); TextView CarbsText = product_Info.FindViewById <TextView>(Resource.Id.CarbsText); TextView WaterText = product_Info.FindViewById <TextView>(Resource.Id.WaterText); TextView CcalsText = product_Info.FindViewById <TextView>(Resource.Id.CcalsText); //Temporary product for getting information about choosed product. Product TempProduct = database_Products.GetProduct(ListForProducts.ElementAt(e.Position)); //Showing information. NameText.Text = TempProduct.Name; ProteinsText.Text = TempProduct.Protein.ToString(); FatsText.Text = TempProduct.Fats.ToString(); CarbsText.Text = TempProduct.Carbohydrates.ToString(); WaterText.Text = TempProduct.Water.ToString(); CcalsText.Text = TempProduct.Ccal.ToString(); //Action on positive button. Object.SetPositiveButton(Resource.String.OK, new EventHandler <DialogClickEventArgs>(delegate(object Sender, DialogClickEventArgs e1) {})); Object.Show(); }
private void List_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { var builder = new Android.Support.V7.App.AlertDialog.Builder(Activity); var position = e.Position; //var _unitNumber = list.Adapter.GetItem(position).ToString().Split('|')[1]; var _repairCode = list.Adapter.GetItem(position).ToString().Split('|')[0]; builder.SetTitle("Warning"); builder.SetIcon(Android.Resource.Drawable.IcDialogAlert); builder.SetMessage("Do you want to remove repair " + _repairCode + " from current load?"); builder.SetNegativeButton("No", delegate { }); builder.SetPositiveButton("Yes", delegate { var _SP = new SP(Values.gDatos, "pDelRepairs2Load"); _SP.AddParameterValue("RepairCode", _repairCode); _SP.AddParameterValue("LoadNumber", Loads.LoadNumber); _SP.Execute(); if (_SP.LastMsg != "OK") { throw (new Exception(_SP.LastMsg)); } Activity.RunOnUiThread(() => Toast.MakeText(Activity, "Repair " + _repairCode + " removed.", ToastLength.Long).Show()); ((ListLoadsRepairsAdapter)list.Adapter).NotifyDataSetChanged(); //list.InvalidateViews(); }); builder.Create().Show(); }
private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Czy na pewno chcesz usunąć utwór " + GlobalMemory.ActualPlaylistSongs[Convert.ToInt32(e.Position)].Name); alert.SetPositiveButton("TAK", async(senderAlert, args) => { progressBar.Visibility = ViewStates.Visible; if (await APIHelper.DeleteSongFromPlaylist(GlobalMemory.ActualPlaylist.PlaylistsSongs.ToList()[Convert.ToInt32(e.Position)].PlaylistsSongsID)) { GlobalMemory.ActualPlaylistSongs.RemoveAt(Convert.ToInt32(e.Position)); listView.Adapter = listView.Adapter = new SongAdapter(this, Resource.Layout.model, GlobalMemory.ActualPlaylistSongs); progressBar.Visibility = ViewStates.Gone; Toast.MakeText(this, "Utwór został usunięty", ToastLength.Short); } else { Toast.MakeText(this, "Coś poszło nie tak", ToastLength.Short); progressBar.Visibility = ViewStates.Gone; } }); alert.SetNegativeButton("NIE", (senderAlert, args) => { Toast.MakeText(this, "Anulowano", ToastLength.Long).Show(); }); RunOnUiThread(() => { alert.Show(); }); }
private void ImageGrid_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { try { _selectedItemIndex = e.Position; GlobalData.MyLastSelectedImageIndex = _selectedItemIndex; Intent intent = new Intent(this, typeof(ImageDetailActivity)); intent.PutExtra("imageUri", GlobalData.ImageListItems[_selectedItemIndex].ImageryURI); intent.PutExtra("imageComment", GlobalData.ImageListItems[_selectedItemIndex].ImageryComment); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { ActivityOptions options = ActivityOptions.MakeSceneTransitionAnimation(this, e.View, "imageTransition"); Log.Info(TAG, "ImageGrid_ItemClick: Created activity options for image transition as Version code >= Lollipop"); StartActivity(intent, options.ToBundle()); } else { Log.Info(TAG, "ImageGrid_ItemClick: Starting regular activity"); StartActivity(intent); } } catch (Exception ex) { Log.Error(TAG, "ImageGrid_ItemClick: Exception - " + ex.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorImageryActivitySelect), "ImageryActivity.ImageGrid_ItemClick"); } } }
private void LvwNotification_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { if (inDeleteToolbar) { return; } else { LNotication notification = adapterLvw[e.Position]; Log.Info("LongPress", $"{notification.Id} - {notification.IsSelected}"); notification.IsSelected = true; e.View.SetBackgroundColor(Android.Graphics.Color.LightBlue); itemsSelected++; toolbar.SetBackgroundColor(Android.Graphics.Color.DarkGray); toolbar.InflateMenu(Resource.Menu.NotificationMenu); //toolbar.MenuItemClick -= EditToolbar_MenuItemClick; toolbar.MenuItemClick += EditToolbar_MenuItemClick; toolbar.Title = $"{itemsSelected} seleccionado"; inDeleteToolbar = true; adapterLvw.NotifyDataSetChanged(); } }
void OnListItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { Invoice item = listData.ElementAt(e.Position); PopupMenu menu = new PopupMenu(e.Parent.Context, e.View); menu.Inflate(Resource.Menu.popupHis); if (!rights.InvAllowPrint) { menu.Menu.RemoveItem(Resource.Id.popInvprint); menu.Menu.RemoveItem(Resource.Id.popInvprint2); } menu.MenuItemClick += (s1, arg1) => { if (arg1.Item.ItemId == Resource.Id.popInvprint) { PrintInv(item, 1); } else if (arg1.Item.ItemId == Resource.Id.popInvprint2) { PrintInv(item, 2); } else if (arg1.Item.ItemId == Resource.Id.popInvfilter) { ShowDateRangeLookUp(); } }; menu.Show(); }
private void ListTellMyself_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { try { var adapter = _listTellMyself.Adapter; var selectedIndexID = (int)adapter.GetItemId(e.Position); var genericTextItem = GlobalData.TellMyselfItemsList.Find(gen => gen.ID == selectedIndexID); //we don't want to edit a recording really if (genericTextItem.TellType == ConstantsAndTypes.TELL_TYPE.Audio) { Toast.MakeText(this, Resource.String.TellMyselfAudioNoEditText, ToastLength.Short).Show(); return; } GenericTextDialogFragment genFragment = new GenericTextDialogFragment(this, "Tell Yourself...", GetString(Resource.String.TellMyselfGenericTextTitle), genericTextItem.TellText, selectedIndexID); FragmentTransaction transaction = FragmentManager.BeginTransaction(); genFragment.Show(transaction, genFragment.Tag); } catch (Exception ex) { Log.Error(TAG, "ListTellMyself_ItemLongClick: Exception - " + ex.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorTellMyselfEditEntry), "TellMyselfActivity.ListTellMyself_ItemLongClick"); } } }
public bool OnItemLongClick(AdapterView parent, View view, int position, long id) { var handler = Handler; if (handler == null) { return false; } var itemLongClickEventArg = new AdapterView.ItemLongClickEventArgs(true, parent, view, position, id); handler.Invoke(sender, itemLongClickEventArg); return itemLongClickEventArg.Handled; }