use snackbars instead of toasts (in most cases)

This commit is contained in:
Philipp Crocoll
2025-04-08 10:37:40 +02:00
parent e76f3999b6
commit 17241bc422
41 changed files with 1080 additions and 747 deletions

View File

@@ -52,7 +52,7 @@ namespace keepass2android.services.AutofillBase
if (requestedUrl == null && requestedUuid == null)
{
Kp2aLog.Log("ChooseForAutofillActivityBase: no requestedUrl and no requestedUuid");
Toast.MakeText(this, "Cannot execute query for null.", ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, "Cannot execute query for null.", MessageSeverity.Error);
RestartApp();
return;
}
@@ -255,7 +255,7 @@ namespace keepass2android.services.AutofillBase
{
if (dataset == null)
{
Toast.MakeText(this, "Failed to build an autofill dataset.", ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, "Failed to build an autofill dataset.", MessageSeverity.Error);
return;
}
ReplyIntent.PutExtra(AutofillManager.ExtraAuthenticationResult, dataset);

View File

@@ -710,9 +710,9 @@ namespace keepass2android
string message = _service.GetString(Resource.String.ClearClipboard) + " "
+ _service.GetString(Resource.String.ClearClipboardWarning);
Android.Util.Log.Debug("KP2A", message);
Toast.MakeText(_service,
App.Kp2a.ShowMessage(_service,
message,
ToastLength.Long).Show();
MessageSeverity.Error);
}
}
@@ -781,7 +781,7 @@ namespace keepass2android
InputMethodManager imeManager = (InputMethodManager)ApplicationContext.GetSystemService(InputMethodService);
if (imeManager == null)
{
Toast.MakeText(this, Resource.String.not_possible_im_picker, ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, Resource.String.not_possible_im_picker, MessageSeverity.Error);
return;
}
try
@@ -799,7 +799,7 @@ namespace keepass2android
}
catch (Exception)
{
Toast.MakeText(this, Resource.String.not_possible_im_picker, ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, Resource.String.not_possible_im_picker, MessageSeverity.Error);
}
return;
}
@@ -813,7 +813,7 @@ namespace keepass2android
if (!IsKp2aInputMethodEnabled)
{
//must be enabled in settings first
Toast.MakeText(this, Resource.String.please_activate_keyboard, ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, Resource.String.please_activate_keyboard, MessageSeverity.Info);
Intent settingsIntent = new Intent(Android.Provider.Settings.ActionInputMethodSettings);
try
{
@@ -824,7 +824,7 @@ namespace keepass2android
{
//seems like on Huawei devices this call can fail.
Kp2aLog.LogUnexpectedError(e);
Toast.MakeText(this, "Failed to switch keyboard.", ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, "Failed to switch keyboard.", MessageSeverity.Error);
}
}
@@ -847,7 +847,7 @@ namespace keepass2android
{
//seems like on Huawei devices this call can fail.
Kp2aLog.LogUnexpectedError(e);
Toast.MakeText(this, "Failed to switch keyboard.", ToastLength.Long).Show();
App.Kp2a.ShowMessage(this, "Failed to switch keyboard.", MessageSeverity.Error);
}