I want to implement a notification like this:
I know that I can use custom layout notification and set an onClickPendingIntent. But, is this the best option? If it is not, what is it? And if it is, how can I mimic the left square with the icon? Measures, color, etc.
Yes, that is the best option. Use RemoteViews to create your custom layout, and make sure to use onClickPendingIntent and not setContentIntent for UNDO action. If you use the second approach notification bar gets minimized and that's not something you want if you want to seamlessly update the notification once again after user presses UNDO like Gmail does.
If you want to align your icon with non-custom notifications use following dimensions: https://www.google.com/design/spec/patterns/notifications.html#notifications-content
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With