android - How to rotate floating action button without rotaing shadow? -
i rotate fab in such simple way:
fab.startanimation(animationutils.loadanimation(this, r.anim.rotate));
rotate.xml:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <rotate android:fromdegrees="0" android:todegrees="360" android:pivotx="50%" android:pivoty="50%" android:duration="1000"/> </set>
this works, fab shadow rotates. need fab rotate (or src image, if there's difference).
did try animate method provided compat library? had same problem when using animation utils
final overshootinterpolator interpolator = new overshootinterpolator(); viewcompat.animate(fab). rotation(135f). withlayer(). setduration(300). setinterpolator(interpolator). start();
Comments
Post a Comment