Skip to content

Use vector support libraries instead of rasterizing all drawables

Torsten Grote requested to merge vector-compat into master

Currently, the android gradle plugin rasterizes all our drawables for all possible resolutions and stores PNG files for those. These are used on phones with API < 21, but can lead to blurry icons if the dp value in the xml file is not matching the actual size on screen. Also it takes up more space in the APK.

This MR enables the androidx library support for vector drawables, so we can use them on lower API levels as well and makes the required code modifications. NotificationCompat doesn't take care (yet?) of using VectorDrawables for notifications, so the only solution is to include pre-rasterized icons only for notifications.

Official documentation: https://developer.android.com/guide/topics/graphics/vector-drawable-resources#vector-drawables-backward-solution

Merge request reports