I would like to show progress bar (in form of rotating circle or something similar) when loading image from remote location.
I don't want standard ProgressBar that gets shown in the middle of the screen. I would like to have it in the middle of the imageView (or Layout that holds ImageView). Is there easy way to do this? For example, do I have option to attach progressBar to some View?
I was reading about FrameAnimation. I think I will do that, but first I want to make sure that I am not reinventing the wheel.
Thanks.
you can attach a ProgressBar into ImageView layout holder,
RelativeLayout -> ImageView ->ProgressBar
then you can set layout align params to the progress bar to show it where you want.
you can do this in a xml layout and inflating later programatically, so, when you start/stop the image download process you can set the ProgressBar visibility on/off
Do you mean like a spinner ?
Yes you can do that:
heres a sample code:
Here are some other style attributes you can use, just replace above style attributes with one of these, e.g.
style=?android:attr/<one of the attribute from below list>
You must also note that if you are downloading image from internet do not use UIThread. And you can also add progress bar in the title bar.
Add spinner to title bar with following code(call request.. in onCreate()):
Hope this helps. Cheers!