Android Question How can I made a notification like this?

asales

Well-Known Member
Licensed User
Longtime User
1661199260194.png


I tried with the options from NB6 class, but could not made as the image (image left, action button right).

Thanks in advance for any tip.
 

Daica

Active Member
Licensed User
Is it an actual button or is just an image with the button in it?

Maybe try this?
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
This is a notification to the statusbar.
The height of the status bar is not that big. I therefore wonder how I can see a very small displayed image and operate a very small key on that status bar with my thick fingers. In addition, a statusbar, the name says it all, is intended for statuses and not actually for operating elements such as a key. You could of course also display a (semi) transparent panel with the desired layout at the top over the screen content.
 
Upvote 0

asales

Well-Known Member
Licensed User
Longtime User
Maybe I can explain better.

This is a normal notification, like the one sent by Firebase Push.

I took the example from this app (sometimes on day it show this notifications):

There are few customizations to the notifications, using the NB6 class.
I just don't know how do to make a similar notification (Bible image left, green action button right). using this class.
1661354839049.png
 
Upvote 0

Marvel

Active Member
Licensed User
Check this file. That's the code I used for an app I'm working on.

Take note of the XML file inside Objects\res\layout, that is how you design the layout. In this case, I only show an image. You can also add a button or text if you want.

NOTES
- The XML files must be set to read-only after editing
- I found that the exact size of the image I used for the notifications worked well on most phones I tested on. Anything smaller or larger will cause some sizing issues when the notification is shown, You should play around with the image sizes and aspect ratio.
- I used the NotificationBuilder library for this.
 

Attachments

  • Image Notification.zip
    231.8 KB · Views: 63
Upvote 0
Top