Update notification & app switcher icon
15
res/drawable-anydpi-v24/ic_notification.xml
Normal 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>
|
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
BIN
res/drawable-hdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
BIN
res/drawable-mdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 2.3 KiB |
BIN
res/drawable-xhdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
res/drawable-xxhdpi/ic_notification.png
Normal file
After Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 16 KiB |
@ -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
|
||||
|
@ -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()))
|
||||
|
@ -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));
|
||||
|
@ -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))
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|