diff --git a/res/drawable-anydpi-v24/ic_notification.xml b/res/drawable-anydpi-v24/ic_notification.xml new file mode 100644 index 0000000000..16a8f44ff8 --- /dev/null +++ b/res/drawable-anydpi-v24/ic_notification.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/res/drawable-hdpi-v11/icon_notification.png b/res/drawable-hdpi-v11/icon_notification.png deleted file mode 100644 index 025ce4d94d..0000000000 Binary files a/res/drawable-hdpi-v11/icon_notification.png and /dev/null differ diff --git a/res/drawable-hdpi-v9/icon_notification.png b/res/drawable-hdpi-v9/icon_notification.png deleted file mode 100644 index f0f52a2a81..0000000000 Binary files a/res/drawable-hdpi-v9/icon_notification.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_notification.png b/res/drawable-hdpi/ic_notification.png new file mode 100644 index 0000000000..533399d126 Binary files /dev/null and b/res/drawable-hdpi/ic_notification.png differ diff --git a/res/drawable-hdpi/ic_signal_grey_24dp.png b/res/drawable-hdpi/ic_signal_grey_24dp.png deleted file mode 100644 index 0389fadccc..0000000000 Binary files a/res/drawable-hdpi/ic_signal_grey_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi-v11/icon_notification.png b/res/drawable-mdpi-v11/icon_notification.png deleted file mode 100644 index 47a1f321a8..0000000000 Binary files a/res/drawable-mdpi-v11/icon_notification.png and /dev/null differ diff --git a/res/drawable-mdpi-v9/icon_notification.png b/res/drawable-mdpi-v9/icon_notification.png deleted file mode 100644 index 1f550ea855..0000000000 Binary files a/res/drawable-mdpi-v9/icon_notification.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_notification.png b/res/drawable-mdpi/ic_notification.png new file mode 100644 index 0000000000..e8598325dd Binary files /dev/null and b/res/drawable-mdpi/ic_notification.png differ diff --git a/res/drawable-mdpi/ic_signal_grey_24dp.png b/res/drawable-mdpi/ic_signal_grey_24dp.png deleted file mode 100644 index 3a7bdd081b..0000000000 Binary files a/res/drawable-mdpi/ic_signal_grey_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi-v11/icon_notification.png b/res/drawable-xhdpi-v11/icon_notification.png deleted file mode 100644 index 4df63e4a81..0000000000 Binary files a/res/drawable-xhdpi-v11/icon_notification.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_notification.png b/res/drawable-xhdpi/ic_notification.png new file mode 100644 index 0000000000..cf00d2407a Binary files /dev/null and b/res/drawable-xhdpi/ic_notification.png differ diff --git a/res/drawable-xhdpi/ic_signal_grey_24dp.png b/res/drawable-xhdpi/ic_signal_grey_24dp.png deleted file mode 100644 index b485f022a8..0000000000 Binary files a/res/drawable-xhdpi/ic_signal_grey_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi-v11/icon_notification.png b/res/drawable-xxhdpi-v11/icon_notification.png deleted file mode 100644 index b47bcea5cd..0000000000 Binary files a/res/drawable-xxhdpi-v11/icon_notification.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_notification.png b/res/drawable-xxhdpi/ic_notification.png new file mode 100644 index 0000000000..b2da66255e Binary files /dev/null and b/res/drawable-xxhdpi/ic_notification.png differ diff --git a/res/drawable-xxhdpi/ic_signal_grey_24dp.png b/res/drawable-xxhdpi/ic_signal_grey_24dp.png deleted file mode 100644 index a7ea1bce21..0000000000 Binary files a/res/drawable-xxhdpi/ic_signal_grey_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi-v11/icon_notification.png b/res/drawable-xxxhdpi-v11/icon_notification.png deleted file mode 100644 index a9715d286a..0000000000 Binary files a/res/drawable-xxxhdpi-v11/icon_notification.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_signal_grey_24dp.png b/res/drawable-xxxhdpi/ic_signal_grey_24dp.png deleted file mode 100644 index 2ee81f64d1..0000000000 Binary files a/res/drawable-xxxhdpi/ic_signal_grey_24dp.png and /dev/null differ diff --git a/src/org/thoughtcrime/securesms/BaseActivity.java b/src/org/thoughtcrime/securesms/BaseActivity.java index e1f03b1a68..06c4eacc07 100644 --- a/src/org/thoughtcrime/securesms/BaseActivity.java +++ b/src/org/thoughtcrime/securesms/BaseActivity.java @@ -1,6 +1,9 @@ package org.thoughtcrime.securesms; +import android.app.ActivityManager; import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; @@ -37,6 +40,12 @@ public abstract class BaseActivity extends FragmentActivity { protected void onResume() { super.onResume(); DynamicLanguageActivityHelper.recreateIfNotInCorrectLanguage(this, TextSecurePreferences.getLanguage(this)); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + String name = getResources().getString(R.string.app_name); + Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_foreground); + int color = getResources().getColor(R.color.loki_darkest_gray); + setTaskDescription(new ActivityManager.TaskDescription(name, icon, color)); + } } @Override diff --git a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java index d74c9e723a..9fec18016d 100644 --- a/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java +++ b/src/org/thoughtcrime/securesms/ExperienceUpgradeActivity.java @@ -266,7 +266,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity implements !TextSecurePreferences.isPasswordDisabled(context)) { Notification notification = new NotificationCompat.Builder(context, NotificationChannels.OTHER) - .setSmallIcon(R.drawable.icon_notification) + .setSmallIcon(R.drawable.ic_notification) .setColor(context.getResources().getColor(R.color.signal_primary)) .setContentTitle(context.getString(R.string.ExperienceUpgradeActivity_unlock_to_complete_update)) .setContentText(context.getString(R.string.ExperienceUpgradeActivity_please_unlock_signal_to_complete_update)) @@ -295,7 +295,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity implements dismissIntent.setAction(DISMISS_ACTION); Notification notification = new NotificationCompat.Builder(context, NotificationChannels.OTHER) - .setSmallIcon(R.drawable.icon_notification) + .setSmallIcon(R.drawable.ic_notification) .setColor(context.getResources().getColor(R.color.signal_primary)) .setContentTitle(context.getString(experienceUpgrade.get().getNotificationTitle())) .setContentText(context.getString(experienceUpgrade.get().getNotificationText())) diff --git a/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java b/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java index 245a222ea4..fdd508203d 100644 --- a/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java +++ b/src/org/thoughtcrime/securesms/jobs/FcmRefreshJob.java @@ -129,7 +129,7 @@ public class FcmRefreshJob extends BaseJob implements InjectableType { PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntent.FLAG_CANCEL_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.FAILURES); - builder.setSmallIcon(R.drawable.icon_notification); + builder.setSmallIcon(R.drawable.ic_notification); builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_action_warning_red)); builder.setContentTitle(context.getString(R.string.GcmRefreshJob_Permanent_Signal_communication_failure)); diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index e731c702b8..c5b8e93cf7 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -225,7 +225,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType { private void postMigrationNotification() { NotificationManagerCompat.from(context).notify(494949, new NotificationCompat.Builder(context, NotificationChannels.getMessagesChannel(context)) - .setSmallIcon(R.drawable.icon_notification) + .setSmallIcon(R.drawable.ic_notification) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_MESSAGE) .setContentTitle(context.getString(R.string.PushDecryptJob_new_locked_message)) diff --git a/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java index af0508ffe2..084785932b 100644 --- a/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/FailedNotificationBuilder.java @@ -14,7 +14,7 @@ public class FailedNotificationBuilder extends AbstractNotificationBuilder { public FailedNotificationBuilder(Context context, NotificationPrivacyPreference privacy, Intent intent) { super(context, privacy); - setSmallIcon(R.drawable.icon_notification); + setSmallIcon(R.drawable.ic_notification); setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_action_warning_red)); setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_failed)); diff --git a/src/org/thoughtcrime/securesms/notifications/MultipleRecipientNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/MultipleRecipientNotificationBuilder.java index 7daca4a107..5191f907e2 100644 --- a/src/org/thoughtcrime/securesms/notifications/MultipleRecipientNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/MultipleRecipientNotificationBuilder.java @@ -26,7 +26,7 @@ public class MultipleRecipientNotificationBuilder extends AbstractNotificationBu super(context, privacy); setColor(context.getResources().getColor(R.color.textsecure_primary)); - setSmallIcon(R.drawable.icon_notification); + setSmallIcon(R.drawable.ic_notification); setContentTitle(context.getString(R.string.app_name)); setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0)); setCategory(NotificationCompat.CATEGORY_MESSAGE); diff --git a/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java index 2cd058898e..11561b1e65 100644 --- a/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/PendingMessageNotificationBuilder.java @@ -19,7 +19,7 @@ public class PendingMessageNotificationBuilder extends AbstractNotificationBuild Intent intent = new Intent(context, ConversationListActivity.class); - setSmallIcon(R.drawable.icon_notification); + setSmallIcon(R.drawable.ic_notification); setColor(context.getResources().getColor(R.color.textsecure_primary)); setCategory(NotificationCompat.CATEGORY_MESSAGE); diff --git a/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java index 83ecb8858d..88dcf62cc7 100644 --- a/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java @@ -51,7 +51,7 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil { super(context, privacy); - setSmallIcon(R.drawable.icon_notification); + setSmallIcon(R.drawable.ic_notification); setColor(context.getResources().getColor(R.color.textsecure_primary)); setCategory(NotificationCompat.CATEGORY_MESSAGE); diff --git a/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java b/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java index 9ca26774c2..37a6363a9d 100644 --- a/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java +++ b/src/org/thoughtcrime/securesms/service/ApplicationMigrationService.java @@ -127,8 +127,8 @@ public class ApplicationMigrationService extends Service private NotificationCompat.Builder initializeBackgroundNotification() { NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationChannels.OTHER); - builder.setSmallIcon(R.drawable.icon_notification); - builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.icon_notification)); + builder.setSmallIcon(R.drawable.ic_notification); + builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_notification)); builder.setContentTitle(getString(R.string.ApplicationMigrationService_importing_text_messages)); builder.setContentText(getString(R.string.ApplicationMigrationService_import_in_progress)); builder.setOngoing(true); @@ -181,7 +181,7 @@ public class ApplicationMigrationService extends Service @Override public void onReceive(Context context, Intent intent) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.OTHER); - builder.setSmallIcon(R.drawable.icon_notification); + builder.setSmallIcon(R.drawable.ic_notification); builder.setContentTitle(context.getString(R.string.ApplicationMigrationService_import_complete)); builder.setContentText(context.getString(R.string.ApplicationMigrationService_system_database_import_is_complete)); builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0)); diff --git a/src/org/thoughtcrime/securesms/service/GenericForegroundService.java b/src/org/thoughtcrime/securesms/service/GenericForegroundService.java index 4cfe8988fd..b603af1644 100644 --- a/src/org/thoughtcrime/securesms/service/GenericForegroundService.java +++ b/src/org/thoughtcrime/securesms/service/GenericForegroundService.java @@ -55,7 +55,7 @@ public class GenericForegroundService extends Service { private void handleStart(@NonNull Intent intent) { String title = Preconditions.checkNotNull(intent.getStringExtra(EXTRA_TITLE)); String channelId = Preconditions.checkNotNull(intent.getStringExtra(EXTRA_CHANNEL_ID)); - int iconRes = intent.getIntExtra(EXTRA_ICON_RES, R.drawable.ic_signal_grey_24dp); + int iconRes = intent.getIntExtra(EXTRA_ICON_RES, R.drawable.ic_notification); Log.i(TAG, "handleStart() Title: " + title + " ChannelId: " + channelId); @@ -104,7 +104,7 @@ public class GenericForegroundService extends Service { } public static void startForegroundTask(@NonNull Context context, @NonNull String task, @NonNull String channelId) { - startForegroundTask(context, task, channelId, R.drawable.ic_signal_grey_24dp); + startForegroundTask(context, task, channelId, R.drawable.ic_notification); } public static void startForegroundTask(@NonNull Context context, @NonNull String task, @NonNull String channelId, @DrawableRes int iconRes) { diff --git a/src/org/thoughtcrime/securesms/service/IncomingMessageObserver.java b/src/org/thoughtcrime/securesms/service/IncomingMessageObserver.java index c0d7ac95aa..4f3623ba7c 100644 --- a/src/org/thoughtcrime/securesms/service/IncomingMessageObserver.java +++ b/src/org/thoughtcrime/securesms/service/IncomingMessageObserver.java @@ -201,7 +201,7 @@ public class IncomingMessageObserver implements InjectableType, ConstraintObserv builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled)); builder.setPriority(NotificationCompat.PRIORITY_MIN); builder.setWhen(0); - builder.setSmallIcon(R.drawable.ic_signal_background_connection); + builder.setSmallIcon(R.drawable.ic_notification); startForeground(FOREGROUND_ID, builder.build()); return Service.START_STICKY; diff --git a/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java b/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java index 50f5ded14c..98749c06eb 100644 --- a/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java +++ b/src/org/thoughtcrime/securesms/service/UpdateApkReadyListener.java @@ -67,7 +67,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver { .setOngoing(true) .setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update)) .setContentText(context.getString(R.string.UpdateApkReadyListener_a_new_version_of_signal_is_available_tap_to_update)) - .setSmallIcon(R.drawable.icon_notification) + .setSmallIcon(R.drawable.ic_notification) .setColor(context.getResources().getColor(R.color.textsecure_primary)) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_REMINDER)