I have this application that I am working on and the user can mark some items as a favorite. I want to use a heart shaped button for this functionality instead of the casual one is it possible?
相关问题
- How can I create this custom Bottom Navigation on
- Illegal to have multiple roots (start tag in epilo
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Creating XML Elements without namespace declaratio
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Get Attribute Value From Simple XML Using JQuery /
You can use VectorAssets as below in XML.
You can create VectorAssets doing: new Vector Asset > Change Icon -- Here you can choose love vector asset. These VectorAssets, you can store in the drawable folder. Then you can import than in your XML layout file as
For the demo, please see below picture. The VectorAsset XML file is ic_favorite_black_24dp
You can change the color of the VectorAsset also. On click, you can replace VectorAsset with another Red colored VectorAsset to represent it favorite and so on.
You can do it by adding a heart graphic asset and then putting it in an ImageButton, then for the animations you should work some more.
There is a Star/Rate button native, but nancy fancy.
I would recommend this for what you are looking for: https://android-arsenal.com/details/1/3038