Update notification & app switcher icon

This commit is contained in:
Niels Andriesse 2019-07-24 09:51:09 +10:00
parent c89c1632be
commit 1b7a04ab50
29 changed files with 39 additions and 15 deletions

View File

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1109.6405"
android:viewportHeight="1109.7455"
android:tint="#FFFFFF">
<group android:translateX="-466.04904"
android:translateY="-466.09314">
<group android:translateX="492.4193"
android:translateY="520.9659">
<path android:fillColor="#FFFFFF" android:pathData="M480,730.8l-358.6,-358.5l371.8,-371.8l99,99.1l-272.6,272.7l259.4,259.5z"/>
<path android:fillColor="#FFFFFF" android:pathData="M563.7,999.5l-99.1,-99.1l272.7,-272.7l-259.5,-259.5l99.1,-99l358.5,358.5z"/>
</group>
</group>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,6 +1,9 @@
package org.thoughtcrime.securesms; package org.thoughtcrime.securesms;
import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build; import android.os.Build;
import android.os.Build.VERSION; import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES; import android.os.Build.VERSION_CODES;
@ -37,6 +40,12 @@ public abstract class BaseActivity extends FragmentActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
DynamicLanguageActivityHelper.recreateIfNotInCorrectLanguage(this, TextSecurePreferences.getLanguage(this)); 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 @Override

View File

@ -266,7 +266,7 @@ public class ExperienceUpgradeActivity extends BaseActionBarActivity implements
!TextSecurePreferences.isPasswordDisabled(context)) !TextSecurePreferences.isPasswordDisabled(context))
{ {
Notification notification = new NotificationCompat.Builder(context, NotificationChannels.OTHER) 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)) .setColor(context.getResources().getColor(R.color.signal_primary))
.setContentTitle(context.getString(R.string.ExperienceUpgradeActivity_unlock_to_complete_update)) .setContentTitle(context.getString(R.string.ExperienceUpgradeActivity_unlock_to_complete_update))
.setContentText(context.getString(R.string.ExperienceUpgradeActivity_please_unlock_signal_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); dismissIntent.setAction(DISMISS_ACTION);
Notification notification = new NotificationCompat.Builder(context, NotificationChannels.OTHER) 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)) .setColor(context.getResources().getColor(R.color.signal_primary))
.setContentTitle(context.getString(experienceUpgrade.get().getNotificationTitle())) .setContentTitle(context.getString(experienceUpgrade.get().getNotificationTitle()))
.setContentText(context.getString(experienceUpgrade.get().getNotificationText())) .setContentText(context.getString(experienceUpgrade.get().getNotificationText()))

View File

@ -129,7 +129,7 @@ public class FcmRefreshJob extends BaseJob implements InjectableType {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.FAILURES); 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(), builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
R.drawable.ic_action_warning_red)); R.drawable.ic_action_warning_red));
builder.setContentTitle(context.getString(R.string.GcmRefreshJob_Permanent_Signal_communication_failure)); builder.setContentTitle(context.getString(R.string.GcmRefreshJob_Permanent_Signal_communication_failure));

View File

@ -225,7 +225,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
private void postMigrationNotification() { private void postMigrationNotification() {
NotificationManagerCompat.from(context).notify(494949, NotificationManagerCompat.from(context).notify(494949,
new NotificationCompat.Builder(context, NotificationChannels.getMessagesChannel(context)) new NotificationCompat.Builder(context, NotificationChannels.getMessagesChannel(context))
.setSmallIcon(R.drawable.icon_notification) .setSmallIcon(R.drawable.ic_notification)
.setPriority(NotificationCompat.PRIORITY_HIGH) .setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_MESSAGE) .setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setContentTitle(context.getString(R.string.PushDecryptJob_new_locked_message)) .setContentTitle(context.getString(R.string.PushDecryptJob_new_locked_message))

View File

@ -14,7 +14,7 @@ public class FailedNotificationBuilder extends AbstractNotificationBuilder {
public FailedNotificationBuilder(Context context, NotificationPrivacyPreference privacy, Intent intent) { public FailedNotificationBuilder(Context context, NotificationPrivacyPreference privacy, Intent intent) {
super(context, privacy); super(context, privacy);
setSmallIcon(R.drawable.icon_notification); setSmallIcon(R.drawable.ic_notification);
setLargeIcon(BitmapFactory.decodeResource(context.getResources(), setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
R.drawable.ic_action_warning_red)); R.drawable.ic_action_warning_red));
setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_failed)); setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_failed));

View File

@ -26,7 +26,7 @@ public class MultipleRecipientNotificationBuilder extends AbstractNotificationBu
super(context, privacy); super(context, privacy);
setColor(context.getResources().getColor(R.color.textsecure_primary)); 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)); setContentTitle(context.getString(R.string.app_name));
setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0)); setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0));
setCategory(NotificationCompat.CATEGORY_MESSAGE); setCategory(NotificationCompat.CATEGORY_MESSAGE);

View File

@ -19,7 +19,7 @@ public class PendingMessageNotificationBuilder extends AbstractNotificationBuild
Intent intent = new Intent(context, ConversationListActivity.class); 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)); setColor(context.getResources().getColor(R.color.textsecure_primary));
setCategory(NotificationCompat.CATEGORY_MESSAGE); setCategory(NotificationCompat.CATEGORY_MESSAGE);

View File

@ -51,7 +51,7 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
{ {
super(context, privacy); super(context, privacy);
setSmallIcon(R.drawable.icon_notification); setSmallIcon(R.drawable.ic_notification);
setColor(context.getResources().getColor(R.color.textsecure_primary)); setColor(context.getResources().getColor(R.color.textsecure_primary));
setCategory(NotificationCompat.CATEGORY_MESSAGE); setCategory(NotificationCompat.CATEGORY_MESSAGE);

View File

@ -127,8 +127,8 @@ public class ApplicationMigrationService extends Service
private NotificationCompat.Builder initializeBackgroundNotification() { private NotificationCompat.Builder initializeBackgroundNotification() {
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationChannels.OTHER); NotificationCompat.Builder builder = new NotificationCompat.Builder(this, NotificationChannels.OTHER);
builder.setSmallIcon(R.drawable.icon_notification); builder.setSmallIcon(R.drawable.ic_notification);
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.icon_notification)); builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_notification));
builder.setContentTitle(getString(R.string.ApplicationMigrationService_importing_text_messages)); builder.setContentTitle(getString(R.string.ApplicationMigrationService_importing_text_messages));
builder.setContentText(getString(R.string.ApplicationMigrationService_import_in_progress)); builder.setContentText(getString(R.string.ApplicationMigrationService_import_in_progress));
builder.setOngoing(true); builder.setOngoing(true);
@ -181,7 +181,7 @@ public class ApplicationMigrationService extends Service
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.OTHER); 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.setContentTitle(context.getString(R.string.ApplicationMigrationService_import_complete));
builder.setContentText(context.getString(R.string.ApplicationMigrationService_system_database_import_is_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)); builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0));

View File

@ -55,7 +55,7 @@ public class GenericForegroundService extends Service {
private void handleStart(@NonNull Intent intent) { private void handleStart(@NonNull Intent intent) {
String title = Preconditions.checkNotNull(intent.getStringExtra(EXTRA_TITLE)); String title = Preconditions.checkNotNull(intent.getStringExtra(EXTRA_TITLE));
String channelId = Preconditions.checkNotNull(intent.getStringExtra(EXTRA_CHANNEL_ID)); 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); 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) { 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) { public static void startForegroundTask(@NonNull Context context, @NonNull String task, @NonNull String channelId, @DrawableRes int iconRes) {

View File

@ -201,7 +201,7 @@ public class IncomingMessageObserver implements InjectableType, ConstraintObserv
builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled)); builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled));
builder.setPriority(NotificationCompat.PRIORITY_MIN); builder.setPriority(NotificationCompat.PRIORITY_MIN);
builder.setWhen(0); builder.setWhen(0);
builder.setSmallIcon(R.drawable.ic_signal_background_connection); builder.setSmallIcon(R.drawable.ic_notification);
startForeground(FOREGROUND_ID, builder.build()); startForeground(FOREGROUND_ID, builder.build());
return Service.START_STICKY; return Service.START_STICKY;

View File

@ -67,7 +67,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver {
.setOngoing(true) .setOngoing(true)
.setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update)) .setContentTitle(context.getString(R.string.UpdateApkReadyListener_Signal_update))
.setContentText(context.getString(R.string.UpdateApkReadyListener_a_new_version_of_signal_is_available_tap_to_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)) .setColor(context.getResources().getColor(R.color.textsecure_primary))
.setPriority(NotificationCompat.PRIORITY_HIGH) .setPriority(NotificationCompat.PRIORITY_HIGH)
.setCategory(NotificationCompat.CATEGORY_REMINDER) .setCategory(NotificationCompat.CATEGORY_REMINDER)