I have an ImageView that uses a layer-list as its drawable. It's a compass that shows the bearing of a moving vehicle.
I want to be able to rotate the needle of the compass programmatically and with animation.
compass_overlay.xml:
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/compass_no_needle"/>
<item android:drawable="@drawable/needle_compass"/>
</layer-list>
some_fragment.xml:
...
<ImageView
android:id="@+id/icon_bearing"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:adjustViewBounds="true"
app:srcCompat="@drawable/compass_overlay"/>
...


