views:

340

answers:

3

I have android application with ListView, where each row has own "refresh" button. Refreshing content is based on asynchronous http call, so until it completes (or timeout) I'd like to display some kind of graphical "busy" marker in each affected (clicked) row. What is best practice to do it? I see animated gifs - i.e. ones with rotating circle - does not animate on Android. So far I tried RotateAnimation on static image, it looks OK but it's not what people are accustomed to.

Is there any better way to mark individual row in ListView as being updated? Target SDK is so far 1.5.

+1  A: 

you can do animated gifs

  • Movie.decodeStream if your firmware version supports it

  • or use a Frame Animation as in an <animation-list> on a few images from the image set

jspcal
http://developer.android.com/intl/de/guide/topics/graphics/2d-graphics.html#frame-animation
Mirko Nasato
Note for readers - Frame Animation is more Drawable than Animation, set it with ImageView.setImageResource(R.drawable.anim); and clear with setImageDrawable(null);
tomash
A: 

How about something simple like "Updating..." Android 1.5 [Settings] [Applications] [Manage Applications] uses this for "Computing..." memory while it builds the list of applications.

fupsduck
+1  A: 

I'd just stick with what you have: a RotateAnimation.

CommonsWare
thanks for answer, but I decided to stick with well known rotating circle from http://www.ajaxload.info/
tomash