I've seen the android developers blog that the new design support library 23.2 supports animated vector. When i searched i came across this link to implement animated vector drawable. Is it the same way to implement animated vector drawables in design support library 23.2? Can someone help me out with the new implementation?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Here's a link to an example project on Github implementing the Support Library to make this Floating Action Button.
Using the Support Library is very similar to the non-Support Library method in that the xml files for AnimatedVectorDrawables are the same, as are the objectAnimators and static VectorDrawables.
The differences come when setting up your project to use the Support Library and when referring to the AnimatedVectorDrawables in your code.
Make sure you are using at least version 23.2.0 of AppCompat in your build.gradle, the VectorDrawable and AnimatedVectorDrawable libraries do not need to be added separately:
The official anouncement blog you linked to gives a couple of different ways to ensure Android Studio does not convert your Vector Drawables into pngs. There are two different methods depending on what version of the Gradle plugin you are using, so you should follow the appropriate one.
To call up an Animated Vector from resources in your code:
You can display this on ImageViews, Buttons etc. with their
.setImageDrawable(animatedVector);
method, and start the animation usinganimatedVector.start();
Important note: as mentioned in Chris Banes' post, there are some limitations to what will work in the support library. The sqisland.com post you linked to includes examples of Path Morphing, which won't work with the current support library(version 23.2.0)