we can create a drawable that will be rotated with any number of degrees like this .. create a drawing file like this.
<rotate xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/ic_launcher2" android:fromDegrees="180" android:toDegrees="180" android:visible="true" />
define this file in any accessible folder
if this file name rotates then ..
In android:background="@drawable/rotate" button android:background="@drawable/rotate"
source share