Show an exclamation mark on the notification icon

multisite
Floens 10 years ago
parent d77d3d6ea6
commit 46ca5e68da
  1. 8
      Clover/app/src/main/java/org/floens/chan/ui/service/WatchNotifier.java
  2. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_stat_notify_alert.png
  3. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_stat_notify_alert.png
  4. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_stat_notify_alert.png
  5. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_stat_notify_alert.png
  6. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_stat_notify_alert.png

@ -151,7 +151,7 @@ public class WatchNotifier extends Service {
if (list.size() == 0) { if (list.size() == 0) {
// Idle notification // Idle notification
String message = getString(R.string.watch_idle); String message = getString(R.string.watch_idle);
return getNotificationFor(null, title, message, -1, null, false, false, null); return getNotificationFor(null, title, message, -1, null, false, false, false, null);
} else { } else {
// New posts notification // New posts notification
String message; String message;
@ -193,7 +193,7 @@ public class WatchNotifier extends Service {
ticker = message; ticker = message;
} }
return getNotificationFor(ticker, title, message, -1, lines, makeTicker, makeSound, subject); return getNotificationFor(ticker, title, message, -1, lines, makeTicker, makeSound, true, subject);
} }
} }
@ -211,7 +211,7 @@ public class WatchNotifier extends Service {
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
private Notification getNotificationFor(String tickerText, String contentTitle, String contentText, int contentNumber, private Notification getNotificationFor(String tickerText, String contentTitle, String contentText, int contentNumber,
List<CharSequence> expandedLines, boolean light, boolean makeSound, Pin target) { List<CharSequence> expandedLines, boolean light, boolean makeSound, boolean alert, Pin target) {
Intent intent = new Intent(this, BoardActivity.class); Intent intent = new Intent(this, BoardActivity.class);
intent.setAction(Intent.ACTION_MAIN); intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.addCategory(Intent.CATEGORY_LAUNCHER);
@ -250,7 +250,7 @@ public class WatchNotifier extends Service {
builder.setNumber(contentNumber); builder.setNumber(contentNumber);
} }
builder.setSmallIcon(R.drawable.ic_stat_notify); builder.setSmallIcon(alert ? R.drawable.ic_stat_notify_alert : R.drawable.ic_stat_notify);
Intent pauseWatching = new Intent(this, WatchNotifier.class); Intent pauseWatching = new Intent(this, WatchNotifier.class);
pauseWatching.putExtra("pause_pins", true); pauseWatching.putExtra("pause_pins", true);

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Loading…
Cancel
Save