Refactoring

pull/199/head
M66B 4 years ago
parent 6d0cc9d322
commit 002b81a971

@ -119,15 +119,15 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
private int lastBackStackCount = 0; private int lastBackStackCount = 0;
private Snackbar lastSnackbar = null; private Snackbar lastSnackbar = null;
static final int REQUEST_UNIFIED = 1; static final int PI_UNIFIED = 1;
static final int REQUEST_WHY = 2; static final int PI_WHY = 2;
static final int REQUEST_ALERT = 3; static final int PI_ALERT = 3;
static final int REQUEST_THREAD = 4; static final int PI_THREAD = 4;
static final int REQUEST_OUTBOX = 5; static final int PI_OUTBOX = 5;
static final int REQUEST_ERROR = 6; static final int PI_ERROR = 6;
static final int REQUEST_UPDATE = 7; static final int PI_UPDATE = 7;
static final int REQUEST_WIDGET = 8; static final int PI_WIDGET = 8;
static final int REQUEST_POWER = 9; static final int PI_POWER = 9;
static final String ACTION_VIEW_FOLDERS = BuildConfig.APPLICATION_ID + ".VIEW_FOLDERS"; static final String ACTION_VIEW_FOLDERS = BuildConfig.APPLICATION_ID + ".VIEW_FOLDERS";
static final String ACTION_VIEW_MESSAGES = BuildConfig.APPLICATION_ID + ".VIEW_MESSAGES"; static final String ACTION_VIEW_MESSAGES = BuildConfig.APPLICATION_ID + ".VIEW_MESSAGES";
@ -1042,7 +1042,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Intent update = new Intent(Intent.ACTION_VIEW, Uri.parse(info.html_url)) Intent update = new Intent(Intent.ACTION_VIEW, Uri.parse(info.html_url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piUpdate = PendingIntentCompat.getActivity( PendingIntent piUpdate = PendingIntentCompat.getActivity(
ActivityView.this, REQUEST_UPDATE, update, PendingIntent.FLAG_UPDATE_CURRENT); ActivityView.this, PI_UPDATE, update, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(piUpdate); builder.setContentIntent(piUpdate);
Intent manage = new Intent(ActivityView.this, ActivitySetup.class) Intent manage = new Intent(ActivityView.this, ActivitySetup.class)

@ -4167,7 +4167,7 @@ class Core {
.setAction("unified" + (notify_remove ? ":" + group : "")); .setAction("unified" + (notify_remove ? ":" + group : ""));
content.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); content.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
PendingIntent piContent = PendingIntentCompat.getActivity( PendingIntent piContent = PendingIntentCompat.getActivity(
context, ActivityView.REQUEST_UNIFIED, content, PendingIntent.FLAG_UPDATE_CURRENT); context, ActivityView.PI_UNIFIED, content, PendingIntent.FLAG_UPDATE_CURRENT);
Intent clear = new Intent(context, ServiceUI.class).setAction("clear:" + group); Intent clear = new Intent(context, ServiceUI.class).setAction("clear:" + group);
PendingIntent piClear = PendingIntentCompat.getService( PendingIntent piClear = PendingIntentCompat.getService(
@ -4291,7 +4291,7 @@ class Core {
thread.putExtra("thread", message.thread); thread.putExtra("thread", message.thread);
thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(message.folderType)); thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(message.folderType));
piContent = PendingIntentCompat.getActivity( piContent = PendingIntentCompat.getActivity(
context, ActivityView.REQUEST_THREAD, thread, PendingIntent.FLAG_UPDATE_CURRENT); context, ActivityView.PI_THREAD, thread, PendingIntent.FLAG_UPDATE_CURRENT);
} }
Intent ignore = new Intent(context, ServiceUI.class).setAction("ignore:" + message.id); Intent ignore = new Intent(context, ServiceUI.class).setAction("ignore:" + message.id);
@ -4721,7 +4721,7 @@ class Core {
intent.setAction("error"); intent.setAction("error");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntentCompat.getActivity( PendingIntent pi = PendingIntentCompat.getActivity(
context, ActivityView.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); context, ActivityView.PI_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT);
// Build notification // Build notification
NotificationCompat.Builder builder = NotificationCompat.Builder builder =

@ -135,7 +135,7 @@ public class ServicePowerControl extends ControlsProviderService {
Context context = getBaseContext(); Context context = getBaseContext();
return PendingIntentCompat.getActivity( return PendingIntentCompat.getActivity(
context, context,
ActivityView.REQUEST_POWER, ActivityView.PI_POWER,
new Intent(context, ActivitySetup.class) new Intent(context, ActivitySetup.class)
.setAction("misc") .setAction("misc")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

@ -255,7 +255,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
intent.setAction("outbox"); intent.setAction("outbox");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntentCompat.getActivity( return PendingIntentCompat.getActivity(
context, ActivityView.REQUEST_OUTBOX, intent, PendingIntent.FLAG_UPDATE_CURRENT); context, ActivityView.PI_OUTBOX, intent, PendingIntent.FLAG_UPDATE_CURRENT);
} }
ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() { ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {

@ -1097,7 +1097,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
why.setAction("why"); why.setAction("why");
why.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); why.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piWhy = PendingIntentCompat.getActivity( PendingIntent piWhy = PendingIntentCompat.getActivity(
this, ActivityView.REQUEST_WHY, why, PendingIntent.FLAG_UPDATE_CURRENT); this, ActivityView.PI_WHY, why, PendingIntent.FLAG_UPDATE_CURRENT);
// Build notification // Build notification
NotificationCompat.Builder builder = NotificationCompat.Builder builder =
@ -1134,7 +1134,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
alert.setAction("alert"); alert.setAction("alert");
alert.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); alert.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piAlert = PendingIntentCompat.getActivity( PendingIntent piAlert = PendingIntentCompat.getActivity(
this, ActivityView.REQUEST_ALERT, alert, PendingIntent.FLAG_UPDATE_CURRENT); this, ActivityView.PI_ALERT, alert, PendingIntent.FLAG_UPDATE_CURRENT);
// Build notification // Build notification
NotificationCompat.Builder builder = NotificationCompat.Builder builder =

@ -85,7 +85,7 @@ public class Widget extends AppWidgetProvider {
view.putExtra("version", version); view.putExtra("version", version);
view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
pi = PendingIntentCompat.getActivity( pi = PendingIntentCompat.getActivity(
context, ActivityView.REQUEST_UNIFIED, view, PendingIntent.FLAG_UPDATE_CURRENT); context, ActivityView.PI_UNIFIED, view, PendingIntent.FLAG_UPDATE_CURRENT);
} else { } else {
Intent view = new Intent(context, ActivityView.class); Intent view = new Intent(context, ActivityView.class);
view.setAction("folders:" + account); view.setAction("folders:" + account);

@ -91,7 +91,7 @@ public class WidgetUnified extends AppWidgetProvider {
thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(type)); thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(type));
thread.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); thread.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piItem = PendingIntent.getActivity( PendingIntent piItem = PendingIntent.getActivity(
context, ActivityView.REQUEST_WIDGET, thread, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntentCompat.FLAG_MUTABLE); context, ActivityView.PI_WIDGET, thread, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntentCompat.FLAG_MUTABLE);
views.setPendingIntentTemplate(R.id.lv, piItem); views.setPendingIntentTemplate(R.id.lv, piItem);

Loading…
Cancel
Save