Firstly
I noticed when creating a new project in Android Studio it generates drawable-v24 folder with ic_launcher_foreground.xml icon.
And my question is:
- If vector drawables were introduced before v24 then why does it put the vector asset in
drawable-v24and not indrawable-v21folder?
Secondly
Another generated asset is ic_launcher_background.xml which is created in res/drawable folder and was later referenced from mipmap-anydpi-v26/ic_launcher.xml.
- If it is only used in API v26+ (adaptive icons) then why was it created in
res/drawablefolder and not inres/drawable-v24or inres/drawable-v26? Is it due to some nature of mipmap folders?
The VectorDrawable feature is somewhat integrated in API-24 though it was introduced from API-21. I think Google's developers think API-24+ is ideal or stable for adaptive icons.
For example, Nick Butcher (Android designer + developer @ Google) said in his article: Using vector assets in Android apps (Dec 11, 2018),
And about
ic_launcher_background, it is referenced only frommipmap-anydpi-v26/ic_launcher.xmlandmipmap-anydpi-v26/ic_launcher_round.xml. I think it is just that there is no need to prevent from referencing it directly (It has already prevented by placingic_launcher.xmlandic_launcher_round.xmlinmipmap-anydpi-v26folder). There should be not so far more, deep meanings.