Otherwise it delegates to the platform implementation, so still receives any improvements on newer releases (for example VectorDrawable was re-implemented in C in API 24 for increased performance).įor these reasons you should always use AndroidX, even if you’re fortunate enough to have a minSdkVersion of 24. In fact, AndroidX will use the compat implementation even on some platforms where a native implementation exists ( currently APIs 21–23) to deliver the above benefits. Gradient & ColorStateList fills/strokes (added to platform impl in API 24).Both nonZero and evenOdd path fillTypes -the two common ways of defining the inside of a shape, often used in SVGs ( evenOdd added to platform impl in API 24).For example, using VectorDrawableCompat from AndroidX enables: This obviously increases the range of platforms you can use them on but more than this, it enables backporting of features and bug fixes to older platforms too. AndroidX Firstįrom Lollipop onward, you can use VectorDrawables anywhere you would use other drawable types (referring to them using the standard syntax) but I would instead recommend to always use the AndroidX implementation. This post will outline advice for actually using VectorDrawables in your apps. VectorDrawable was introduced in Lollipop (API 21) and is also available in AndroidX (as VectorDrawableCompat) bringing support all the way back to API 14 (over 99% of devices). ![]() In this post we’ll dive into how to use them in your apps.
0 Comments
Leave a Reply. |