private void OpenDeleteDialog(int position) { var builder = new MaterialAlertDialogBuilder(this); builder.SetMessage(Resource.String.confirmAuthenticatorDelete); builder.SetTitle(Resource.String.warning); builder.SetPositiveButton(Resource.String.delete, async delegate { var auth = _authSource.Get(position); await TryCleanupCustomIcon(auth.Icon); await _authSource.Delete(position); _authListAdapter.NotifyItemRemoved(position); await NotifyWearAppOfChange(); CheckEmptyState(); }); builder.SetNegativeButton(Resource.String.cancel, delegate { }); builder.SetCancelable(true); var dialog = builder.Create(); dialog.Show(); }
private void OnDeleteClick(object item, int position) { var builder = new MaterialAlertDialogBuilder(this); builder.SetMessage(Resource.String.confirmCategoryDelete); builder.SetTitle(Resource.String.warning); builder.SetCancelable(true); builder.SetPositiveButton(Resource.String.delete, async delegate { try { await _categorySource.Delete(position); } catch { ShowSnackbar(Resource.String.genericError, Snackbar.LengthShort); return; } RunOnUiThread(delegate { _categoryListAdapter.NotifyItemRemoved(position); CheckEmptyState(); }); }); builder.SetNegativeButton(Resource.String.cancel, delegate { }); var dialog = builder.Create(); dialog.Show(); }
private void ShowDatabaseErrorDialog() { var builder = new MaterialAlertDialogBuilder(this); builder.SetMessage(Resource.String.databaseError); builder.SetTitle(Resource.String.warning); builder.SetPositiveButton(Resource.String.quit, delegate { Finish(); }); builder.SetCancelable(true); var dialog = builder.Create(); dialog.Show(); }
private void ShowUnencryptedWarning(int warningRes, EventHandler onContinue) { var builder = new MaterialAlertDialogBuilder(Activity); builder.SetTitle(Resource.String.warning); builder.SetMessage(warningRes); builder.SetCancelable(true); builder.SetNegativeButton(Resource.String.cancel, delegate { }); builder.SetPositiveButton(Resource.String.ok, delegate { onContinue.Invoke(this, EventArgs.Empty); }); builder.Create().Show(); }
private void OnDeleteClick(object item, int position) { var builder = new MaterialAlertDialogBuilder(this); builder.SetMessage(Resource.String.confirmCategoryDelete); builder.SetTitle(Resource.String.warning); builder.SetCancelable(true); builder.SetPositiveButton(Resource.String.delete, async delegate { var category = _categorySource.Get(position); if (category == null) { return; } if (_preferences.DefaultCategory == category.Id) { SetDefaultCategory(null); } try { await _categorySource.Delete(position); } catch (Exception e) { Logger.Error(e); ShowSnackbar(Resource.String.genericError, Snackbar.LengthShort); return; } RunOnUiThread(delegate { _categoryListAdapter.NotifyItemRemoved(position); CheckEmptyState(); }); }); builder.SetNegativeButton(Resource.String.cancel, delegate { }); var dialog = builder.Create(); dialog.Show(); }
private void OnDeleteClick(object item, int position) { var builder = new MaterialAlertDialogBuilder(this); builder.SetMessage(Resource.String.confirmCategoryDelete); builder.SetTitle(Resource.String.warning); builder.SetCancelable(true); builder.SetPositiveButton(Resource.String.delete, async(sender, args) => { await _categorySource.Delete(position); _categoryListAdapter.NotifyItemRemoved(position); CheckEmptyState(); }); builder.SetNegativeButton(Resource.String.cancel, (sender, args) => { }); var dialog = builder.Create(); dialog.Show(); }