1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 02:37:16 +00:00

Added send/manage button

This commit is contained in:
M66B 2023-01-28 14:14:01 +01:00
parent 23ade5af2b
commit 8f98aaadb1
2 changed files with 16 additions and 1 deletions

View file

@ -93,7 +93,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
static final int REQUEST_DELETE_ACCOUNT = 11;
static final int REQUEST_IMPORT_PROVIDERS = 12;
static final int PI_MISC = 1;
static final int PI_CONNECTION = 1;
static final int PI_MISC = 2;
static final String ACTION_QUICK_GMAIL = BuildConfig.APPLICATION_ID + ".ACTION_QUICK_GMAIL";
static final String ACTION_QUICK_OAUTH = BuildConfig.APPLICATION_ID + ".ACTION_QUICK_OAUTH";

View file

@ -245,6 +245,20 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
if (lastProgress >= 0)
builder.setProgress(100, lastProgress, false);
if (!lastSuitable) {
Intent manage = new Intent(this, ActivitySetup.class)
.setAction("connection")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)
.putExtra("tab", "connection");
PendingIntent piManage = PendingIntentCompat.getActivity(
this, ActivitySetup.PI_CONNECTION, manage, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Action.Builder actionManage = new NotificationCompat.Action.Builder(
R.drawable.twotone_settings_24,
getString(R.string.title_setup_manage),
piManage);
builder.addAction(actionManage.build());
}
Notification notification = builder.build();
notification.flags |= Notification.FLAG_NO_CLEAR;
return notification;