Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Notification Dynamic Icon

Is it possible to overlay a notification icon with some text/int? or is it possible to generate a custom icon on the fly?

For example I have the current icon displayed for my notification, I would like to be able to display for example the number 2 within the red box.

icon

As this is not a count of notifications ( so not the red bubble ), the setting the "number" in the notification will not work.

Will I have to just create an individual icon for every possible number I wish to display? Or is there a better way of achieving this?

like image 727
kiwijus Avatar asked May 09 '12 19:05

kiwijus


People also ask

Can notification icons change?

1 Tap Notification Settings on the notification panel or tap the Settings app. 2 Tap Notifications. 3 Tap App icon badges.

How to change notification logo in Android mobile?

Navigate to Messages > New Push > Platform Settings > Google Android Options > Set the icon name without the file extension. With Large Notification Icons, you can also supply a URL where the icon will be displayed from.

How to Get notification badges on Android?

Turn on App icon badges from Settings.Navigate back to the main Settings screen, tap Notifications, and then tap Advanced settings. Tap the switch next to App icon badges to turn them on.

What is notification dot on app icon?

Starting with 8.0 (API level 26), notification badges (also known as notification dots) appear on a launcher icon when the associated app has an active notification. Users can long-press on the app icon to reveal the notifications (alongside any app shortcuts), as shown in figure 1.


1 Answers

Try using AnimationDrawable's. You can use them to combine multiple drawables into a single one, and select the one you want to display. I really think, this is the way to go.

More info: AnimationDrawable

Off course, you will have to provide individual drawables for all your Integers you want to display, but this way, you can easily change the appearance of your notifications

like image 59
Entreco Avatar answered Oct 14 '22 17:10

Entreco