Can we use VectorDrawable or VectorXML as icons for push notifications in android?

后端 未结 6 1216
故里飘歌
故里飘歌 2021-01-03 21:06

I am using PNG image but its size is getting too big so I have to compromise with its quality. So i was thinking vectors may be the another way around ? Example will be a gr

6条回答
  •  礼貌的吻别
    2021-01-03 21:38

    UPDATE 2020

    Yes, it is definitely possible. But let Android Studio take care of icon creation. Otherwise you will be at risk of not supporting older Android versions (check other answers).

    So how to create the right files with Android Studio:

    1. Right click on a file on the left side of Android studio
    2. New > Image Assets
    3. Icon Type > Notification Icons

    1. Select a vector image (.svg for example)

    Android studio will create all the correct files needed.

提交回复
热议问题