Move location RemoteViews to a single instance.

This commit is contained in:
Electric
2020-11-16 16:18:35 +02:00
parent 53377a60c8
commit cd8e855428
@@ -284,6 +284,7 @@ public class PodsService extends Service {
String compat = getPackageManager().getInstallerPackageName(getPackageName()); String compat = getPackageManager().getInstallerPackageName(getPackageName());
RemoteViews[] notificationArr = new RemoteViews[] {new RemoteViews(getPackageName(), R.layout.status_big), new RemoteViews(getPackageName(), R.layout.status_small)}; RemoteViews[] notificationArr = new RemoteViews[] {new RemoteViews(getPackageName(), R.layout.status_big), new RemoteViews(getPackageName(), R.layout.status_small)};
RemoteViews[] notificationLocation = new RemoteViews[] {new RemoteViews(getPackageName(), R.layout.location_disabled_big), new RemoteViews(getPackageName(), R.layout.location_disabled_small)};
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(PodsService.this, TAG); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(PodsService.this, TAG);
mBuilder.setShowWhen(false); mBuilder.setShowWhen(false);
@@ -313,8 +314,8 @@ public class PodsService extends Service {
mBuilder.setCustomContentView(notificationArr[1]); mBuilder.setCustomContentView(notificationArr[1]);
mBuilder.setCustomBigContentView(notificationArr[0]); mBuilder.setCustomBigContentView(notificationArr[0]);
} else { } else {
mBuilder.setCustomContentView(new RemoteViews(getPackageName(), R.layout.location_disabled_small)); mBuilder.setCustomContentView(notificationLocation[1]);
mBuilder.setCustomBigContentView(new RemoteViews(getPackageName(), R.layout.location_disabled_big)); mBuilder.setCustomBigContentView(notificationLocation[0]);
} }
if (notificationShowing) { if (notificationShowing) {