I created a frame animation in a drawable file:
<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/photo_circle_anim_1" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_2" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_3" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_4" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_5" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_6" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_7" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_8" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_9" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_10" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_11" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_12" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_13" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_14" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_15" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_16" android:duration="300"/> <item android:drawable="@drawable/photo_circle_anim_17" android:duration="300"/> </animation-list>
After installing this resource file as a button background - the images are stretched by the button, the result is not a circle, but a low-quality oval ..) How to make frame-by-frame animation located only in a small part of the button (for example, 50x50dp) Standard android design of the button?