Jump to content
AlanScottAgain

Colored Notification Icon

Recommended Posts

Hi

Apps like YouTube have colored notification icons - but even when set my image the notification section to a colored png it still appears white.

 

How can I have my icon show colored?

 

Thanks

 

Alan

Share this post


Link to post

Did you try Project Options > Icons > Android > Accent Color?

Share this post


Link to post

Note: notification icons are always monocolor.

Share this post


Link to post

@AlanScottAgain  / @vfbb

 

would be this...

  • all icons should be "Opaque White" for all resolutions
  • in Android / Options / Icons / Notifications: all your custom icons in all res = color: Opaque White  <-- mandatory
    • change the "Accent Color" for your choice
  • you can create all XML file customized and add it manually in your "Deploy project menu"
    • this files: colors.xml, splash_image_def.xml, strings.xml, styles.xml, styles-v21.xml is build after your "BUILD" command in IDE, then, just do it and copy for another place, do the changes, and add it your "Deploy" menu (before add new custom XML, uncheck old (default) files used by Delphi, of course) --> but this is not necessary at all... if you dont need any customization!
      • NOTE: a "colors.xml" file has this content:  (FF0000 = red in my choice)
      • <?xml version="1.0" encoding="utf-8"?>
        <resources xmlns:android="http://schemas.android.com/apk/res/android">
            <color name="notification_accent_color">#FF0000</color>
        </resources>

         

image.thumb.png.576f8d25147f2f069dc2eb8e0bb0a640.pngimage.thumb.png.036be7845561a378d7b3dd3dd6637609.png    

  • Thanks 1

Share this post


Link to post
25 minutes ago, AlanScottAgain said:

I think I was confused because the default notification icon is colored!

Older versions supported multi-color icons (up to Android 6 or 7 if I'm not mistaken). From then on they are treated as mono color. Even if you have your multi-color icon, Android applies a color filter, with the AccentColor color (if the Use Accent Color is selected). When "Use Accent Color" is not selected, your icon will have the default color of the device's theme.
Also, in the Android documentation it is stated that the icon should be white, but in practice there is no difference because Android will apply the color filter anyway. Just don't forget to delete your icon's background.

  • Like 1
  • Thanks 1

Share this post


Link to post

Google allows you to set an accent color for your push notifications. If you don't set a custom accent color, Android will use a grey accent color.

by default only White/Black is used on alphacolor... any other should show a "white square"

 

accentcolor.png

Edited by programmerdelphi2k
  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×