GCM Push Notification Large Icon size

前端 未结 3 1321
南旧
南旧 2020-12-10 02:58

Hi Iam implementing Push Notifications in Android using GCM. I am trying to set an image for the notification instead of the default app icon. I am able to achieve this usin

3条回答
  •  天命终不由人
    2020-12-10 03:30

    The other thing here to know is that the base layouts have margins stated on these images, so if you are trying to mimic the behavior seen by the base layouts in a custom layout make sure to do something similar. Checkout notification_template_icon_group.xml for details.

    Here I have computed the math to pixels for you (64dp - 12dp):

    ldpi 48 - 9 = 39
    mdpi 64 - 12 = 52
    hdpi 96 - 18 = 78
    xhdpi 128 - 24 = 104
    xxhdpi 192 - 36 = 156
    

提交回复
热议问题