Gesture inset ignored what?!

Android space is Android space, app space is app space!
Android problems should be fixed in Android, not in apps!
pull/183/head
M66B 5 years ago
parent a24400c949
commit cbd561e793

@ -125,7 +125,8 @@ public class ActivityDSN extends ActivityBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getSupportFragmentManager(), ex);
}

@ -267,7 +267,8 @@ public class ActivityEML extends ActivityBase {
@Override
protected void onException(Bundle args, @NonNull Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getSupportFragmentManager(), ex);
}
@ -453,7 +454,8 @@ public class ActivityEML extends ActivityBase {
@Override
protected void onException(Bundle args, @NonNull Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(findViewById(android.R.id.content), ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getSupportFragmentManager(), ex);
}

@ -301,7 +301,8 @@ public class ActivitySignature extends ActivityBase {
etText.setSelection(start + 2);
}
} catch (SecurityException ex) {
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE);
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
sb.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -2233,7 +2233,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof OutOfMemoryError)
Snackbar.make(parentFragment.getView(), ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(parentFragment.getView(), ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(parentFragment.getParentFragmentManager(), ex);
}
@ -3300,7 +3301,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Intent pick = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(context.getPackageManager()) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else {
properties.setValue("name", name);
properties.setValue("email", email);
@ -3321,8 +3323,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
PackageManager pm = context.getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
insert.resolveActivity(pm) == null)
Snackbar.make(parentFragment.getView(),
R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(parentFragment.getView(), R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
try {
context.startActivity(insert);
@ -3343,8 +3345,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
PackageManager pm = context.getPackageManager();
if (edit.resolveActivity(pm) == null) // system whitelisted
Snackbar.make(parentFragment.getView(),
R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(parentFragment.getView(), R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
try {
context.startActivity(edit);
@ -4535,9 +4537,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R &&
intent.resolveActivity(pm) == null) // system whitelisted
Snackbar.make(parentFragment.getView(),
context.getString(R.string.title_no_viewer, intent),
Snackbar.LENGTH_LONG).
show();
context.getString(R.string.title_no_viewer, intent), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
context.startActivity(Helper.getChooser(context, intent));
}

@ -332,8 +332,8 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
Snackbar.make(
parentFragment.getView(),
context.getString(R.string.title_rule_applied, applied),
Snackbar.LENGTH_LONG).show();
context.getString(R.string.title_rule_applied, applied), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
}
@Override

@ -594,7 +594,8 @@ public class FragmentAccount extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -766,7 +767,8 @@ public class FragmentAccount extends FragmentBase {
cbIdentity.setVisibility(View.GONE);
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
showError(ex);
}
@ -1287,7 +1289,8 @@ public class FragmentAccount extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
showError(ex);
}

@ -400,7 +400,8 @@ public class FragmentAccounts extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalStateException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -411,7 +412,8 @@ public class FragmentAccounts extends FragmentBase {
});
snackbar.show();
} else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

@ -288,7 +288,8 @@ public class FragmentAnswer extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -333,7 +334,8 @@ public class FragmentAnswer extends FragmentBase {
etText.setText(ssb);
etText.setSelection(start + 2);
} catch (SecurityException ex) {
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE);
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
sb.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -442,7 +442,8 @@ public class FragmentCompose extends FragmentBase {
PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), request);
}
@ -1465,7 +1466,8 @@ public class FragmentCompose extends FragmentBase {
PackageManager pm = getContext().getPackageManager();
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
if (intent.resolveActivity(pm) == null) { // action whitelisted
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_recorder), Snackbar.LENGTH_INDEFINITE);
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_recorder), Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1478,7 +1480,8 @@ public class FragmentCompose extends FragmentBase {
startActivityForResult(intent, REQUEST_RECORD_AUDIO);
} catch (SecurityException ex) {
Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent), Snackbar.LENGTH_INDEFINITE).show();
Snackbar.make(view, getString(R.string.title_no_viewer, intent), Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true).show();
}
}
@ -1509,7 +1512,8 @@ public class FragmentCompose extends FragmentBase {
}
private void noStorageAccessFramework() {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1622,7 +1626,8 @@ public class FragmentCompose extends FragmentBase {
@Override
public void onNothingSelected() {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
final Intent intent = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R
? KeyChain.createInstallIntent()
: new Intent(Settings.ACTION_SECURITY_SETTINGS));
@ -1685,14 +1690,16 @@ public class FragmentCompose extends FragmentBase {
onPgp(intent);
} catch (Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else {
Log.e(ex);
Log.unexpectedError(getParentFragmentManager(), ex);
}
}
else {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1865,7 +1872,8 @@ public class FragmentCompose extends FragmentBase {
PackageManager pm = getContext().getPackageManager();
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (intent.resolveActivity(pm) == null) { // action whitelisted
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_camera), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, getString(R.string.title_no_camera), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -1884,7 +1892,8 @@ public class FragmentCompose extends FragmentBase {
startActivityForResult(intent, REQUEST_TAKE_PHOTO);
} catch (SecurityException ex) {
Log.w(ex);
Snackbar.make(view, getString(R.string.title_no_viewer, intent), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, getString(R.string.title_no_viewer, intent), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
}
}
} else {
@ -1985,7 +1994,8 @@ public class FragmentCompose extends FragmentBase {
if (ex instanceof SecurityException)
handleFileShare();
else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.toString(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.toString(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -2311,7 +2321,8 @@ public class FragmentCompose extends FragmentBase {
else if (ex instanceof IllegalArgumentException
|| ex instanceof GeneralSecurityException /* InvalidKeyException */) {
Log.i(ex);
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
} else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -2586,7 +2597,8 @@ public class FragmentCompose extends FragmentBase {
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException) {
Log.i(ex);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -3790,7 +3802,8 @@ public class FragmentCompose extends FragmentBase {
bottom_navigation.getMenu().findItem(R.id.action_redo).setVisible(data.draft.revision < data.draft.revisions);
if (args.getBoolean("incomplete"))
Snackbar.make(view, R.string.title_attachments_incomplete, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_attachments_incomplete, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
DB db = DB.getInstance(getContext());
@ -3891,9 +3904,11 @@ public class FragmentCompose extends FragmentBase {
else if (ex instanceof SecurityException)
handleFileShare();
else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else if (ex instanceof IllegalStateException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -3908,7 +3923,8 @@ public class FragmentCompose extends FragmentBase {
};
private void handleFileShare() {
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE);
Snackbar sb = Snackbar.make(view, R.string.title_no_stream, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
sb.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -4526,7 +4542,8 @@ public class FragmentCompose extends FragmentBase {
else {
setBusy(false);
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

@ -593,7 +593,8 @@ public class FragmentFolder extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -652,7 +653,8 @@ public class FragmentFolder extends FragmentBase {
pbSave.setVisibility(View.GONE);
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

@ -399,7 +399,8 @@ public class FragmentFolders extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalStateException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -410,7 +411,8 @@ public class FragmentFolders extends FragmentBase {
});
snackbar.show();
} else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -606,7 +608,8 @@ public class FragmentFolders extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalStateException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -617,7 +620,8 @@ public class FragmentFolders extends FragmentBase {
});
snackbar.show();
} else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

@ -550,7 +550,8 @@ public class FragmentIdentity extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException || ex instanceof UnknownHostException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -937,7 +938,8 @@ public class FragmentIdentity extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
showError(ex);
}

@ -954,7 +954,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onExecuted(Bundle args, EntityFolder drafts) {
if (drafts == null)
Snackbar.make(view, R.string.title_no_primary_drafts, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_primary_drafts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
lbm.sendBroadcast(
@ -1423,7 +1424,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalStateException) {
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -1434,7 +1436,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
});
snackbar.show();
} else if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -2082,7 +2085,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -2247,7 +2251,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onExecuted(Bundle args, List<EntityAnswer> answers) {
if (answers == null || answers.size() == 0) {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_answers, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_answers, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -3321,7 +3326,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
prefs.getBoolean("crash_reports_asked", false))
return false;
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_help, Snackbar.LENGTH_INDEFINITE);
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_help, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -3366,7 +3372,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
return false;
}
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_review, Snackbar.LENGTH_INDEFINITE);
final Snackbar snackbar = Snackbar.make(view, R.string.title_ask_review, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -3393,7 +3400,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (prefs.getBoolean("third_party_notified", false))
return false;
final Snackbar snackbar = Snackbar.make(view, R.string.title_third_party, Snackbar.LENGTH_INDEFINITE);
final Snackbar snackbar = Snackbar.make(view, R.string.title_third_party, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -4047,7 +4055,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
if (ex instanceof IllegalStateException) {
// No internet connection
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -4633,7 +4642,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -4700,7 +4710,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
final Snackbar snackbar = Snackbar.make(
content,
getString(R.string.title_move_undo, getDisplay(result), result.size()),
Snackbar.LENGTH_INDEFINITE);
Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -5047,7 +5058,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Helper.openAdvanced(create);
PackageManager pm = getContext().getPackageManager();
if (create.resolveActivity(pm) == null) // system whitelisted
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), create), REQUEST_RAW);
}
@ -5104,7 +5116,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
public void onNothingSelected() {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_key, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
final Intent intent = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R
? KeyChain.createInstallIntent()
: new Intent(Settings.ACTION_SECURITY_SETTINGS));
@ -5133,7 +5146,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
data.putExtra(BuildConfig.APPLICATION_ID, id);
onPgp(data, auto);
} else {
Snackbar snackbar = Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_LONG);
Snackbar snackbar = Snackbar.make(view, R.string.title_no_openpgp, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -5318,13 +5332,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
protected void onExecuted(Bundle args, Void data) {
Snackbar.make(view, R.string.title_raw_saved, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_raw_saved, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
}
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException || ex instanceof FileNotFoundException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else if (!(ex instanceof MessageRemovedException))
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -5610,7 +5626,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
protected void onExecuted(Bundle args, PendingIntent pi) {
if (args.containsKey("sigresult")) {
String text = args.getString("sigresult");
Snackbar.make(view, text, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, text, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
}
if (pi != null)
@ -5630,7 +5647,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException) {
Log.i(ex);
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
} else
Log.unexpectedError(getParentFragmentManager(), ex);
}
@ -5974,7 +5992,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
message = getString(R.string.title_signature_invalid);
else
message = getString(R.string.title_signature_invalid_reason, reason);
Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, message, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
} else
try {
String sender = args.getString("sender");
@ -5997,7 +6016,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
if (known && !record.isExpired(time) && match && valid)
Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_signature_valid, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else {
LayoutInflater inflator = LayoutInflater.from(getContext());
View dview = inflator.inflate(R.layout.dialog_certificate, null);
@ -6102,7 +6122,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
builder.show();
}
} catch (Throwable ex) {
Snackbar.make(view, Log.formatThrowable(ex), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, Log.formatThrowable(ex), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
}
}
}
@ -6111,7 +6132,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException ||
ex instanceof CMSException || ex instanceof KeyChainException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

@ -520,7 +520,8 @@ public class FragmentPop extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else {
tvError.setText(Log.formatThrowable(ex, false));
grpError.setVisibility(View.VISIBLE);

@ -173,7 +173,8 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
if (view == null)
return;
Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE);
Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE)
.setGestureInsetBottomIgnored(true);
snackbar.setAction(R.string.title_setup_help, new View.OnClickListener() {
@Override
public void onClick(View view) {

@ -280,7 +280,8 @@ public class FragmentRule extends FragmentBase {
PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_SENDER);
}
@ -302,7 +303,8 @@ public class FragmentRule extends FragmentBase {
PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
pick.resolveActivity(pm) == null)
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_no_contacts, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
startActivityForResult(Helper.getChooser(getContext(), pick), REQUEST_RECIPIENT);
}
@ -946,7 +948,8 @@ public class FragmentRule extends FragmentBase {
JSONObject jheader = jcondition.optJSONObject("header");
if (jheader != null) {
Snackbar.make(view, R.string.title_rule_no_headers, Snackbar.LENGTH_LONG).show();
Snackbar.make(view, R.string.title_rule_no_headers, Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
return;
}
@ -1060,7 +1063,8 @@ public class FragmentRule extends FragmentBase {
@Override
protected void onException(Bundle args, Throwable ex) {
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG)
.setGestureInsetBottomIgnored(true).show();
else
Log.unexpectedError(getParentFragmentManager(), ex);
}

Loading…
Cancel
Save