How to create a custom notification on Android. Text instead of image

前端 未结 1 1398
耶瑟儿~
耶瑟儿~ 2021-01-23 06:03

I want to create notification like here:

\"enter

Red circle = icon which is always

相关标签:
1条回答
  • 2021-01-23 06:27

    The only text that you can put in the notification area/status bar ("red circle") is ticker text, which disappears after it's displayed (setTicker). The purpose of that area is to remind users that a notification is outstanding, using the small icon (setSmallIcon). You could make 100 different icons, one for each percentage, but then you would not be using Android's standard design guidelines for notifications.

    I suggest that if you want a battery indicator, use 5 battery icons. One icon would be a "full" battery, along with 1 each for 75%, 50%, 25%, and "very low" (in red). I suspect that most users don't need to see exactly how much battery they have left in the status bar. You can then show the exact numbers and estimated time remaining in the full notification.

    0 讨论(0)
提交回复
热议问题