seggy seggy - 1 month ago 9
Android Question

How to use gif image in progress bar

I have tried all code but i can't find solution how use this (GIF)image in my progessbar

XML file

<ProgressBar
android:id="@+id/progressBar"
style="@style/GenericProgressIndicator"
android:layout_width="fill_parent"
android:layout_height="200px"
android:layout_centerInParent="true"
android:visibility="visible"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/animation" >
</ProgressBar>


JAVA File

ProgressBar bar=(ProgressBar)findViewById(R.id.progressBar);


Want to use this image in progress bar
Want to use this image in progress bar

Answer Source

You don't need to use ProgressBar to show a GIF, unless you want to use special functionality that ProgressBar provides (does not look like it).

It's enough to use simple ImageView and some image library that supports GIFs (eg Glide).