Dark icons on dark theme in notification area (v3.14.1)

virtualdj shared this problem 1 year ago
Solved

Thanks for adding the Pause/Resume button in the notification area in 3.14.1.

There's a small cosmetic thing worth fixing, though: with the Dark theme that my Note 4 with KitKat uses, the icons are dark and cannot be seen.


0f7173477743d83ff7654f76d7c769a2


Bye

Comments (6)

photo
1

Good day,


unfortunately I was searching quite a long time and I'm unable to find some method, that may tell me if this top panel is dark or light (I mean as a programmer). So best solution should be create icons with white border that will be usable on dark and also light background.


Thanks for report, problem will be fixed in any of future versions (depend on a free time of a guy who help me with graphics).

photo
1

Thanks, maybe you have already done it, but have you checked these links:

http://stackoverflow.com/q/21647759

http://stackoverflow.com/a/12339924


I'm on KitKat so the API version should be greater than 11.

photo
1

Hello, thanks for the link, but it won't help here. They discuss about known methods how to change icons based on theme of application. But in this case, I need to know color (theme) defined for rest of system and not own application.

photo
1

Yes, you're right, the URLs were wrong sorry.

I've done further searches and it seems that Android also has the action buttons icons white, surrounded by a gray border. Probably because they cannot inherit the theme of the device, as you said.

I've modified the sample project available HERE in this way:


  1. package com.example;
  2. import android.os.Bundle;
  3. import android.app.Activity;
  4. import android.app.Notification;
  5. import android.app.Notification.Builder;
  6. import android.app.NotificationManager;
  7. import android.app.PendingIntent;
  8. import android.content.Context;
  9. import android.view.Menu;
  10. public class MainActivity extends Activity {
  11. private NotificationManager notificationManager;
  12. @Override
  13. public void onCreate(Bundle savedInstanceState) {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.main);
  16. notificationManager = getNotificationManager();
  17. Builder build = new Notification.Builder(this)
  18. .setContentTitle("Notification Example")
  19. .setContentText("Example text")
  20. .setSmallIcon(R.drawable.ic_action_search)
  21. .setPriority(Notification.PRIORITY_HIGH)
  22. .addAction(android.R.drawable.ic_media_pause, "Pause!",
  23. PendingIntent.getActivity(getApplicationContext(), 0,getIntent(), 0, null));
  24. notificationManager.notify(0, build.build());
  25. }
  26. private NotificationManager getNotificationManager() {
  27. return (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  28. }
  29. @Override
  30. public boolean onCreateOptionsMenu(Menu menu) {
  31. getMenuInflater().inflate(R.menu.main, menu);
  32. return true;
  33. }
  34. }

As you can see, I'm using the Android built-in icon android.R.drawable.ic_media_pause as action button with a text "Pause!" (line 27).

The icon appears like this:

60203d0679da0a7f25228bb293601eb1

Then I compiled the APK and launched it on my Note 4 with KitKat. Here's the result:

84ce4e8612939c516e5cd5e505bf92e5

The same APK, when running in a Note 4 of a friend with Lollipop appears in this different way:

ab4b8e454ae2bd3832a9b4827c30286b

So it seems that white is replaced by the accent color, while gray remains the same.

I hope this helps you!

Bye

photo
1

Hi,


hmm thank you very much for such tests!! Seems you are correct. I've changed these icons to completely white color and they are now drawn on my device as dark grey, so tinted correctly by theme. Very interesting. Also useful information with system media icons, which I'll use rather then own PNG icons.


So double-thanks! Will be fixed in next version.

photo
photo
1

You're welcome!

Thanks for fixing it.