I have done some research and found that it’s possible to have a progress bar in the expanded statusbar area but I am still not sure about whether the animation icon is possible or not.
I have tried the answer of this question: Animation in Notification bar Custom View. However, the icon is not animated.
If it’s not possible, could you point me to any documentation that confirms that?
Thanks in advance.
I have done some research and found that it’s possible to have a progress
Share
The video in your referenced question (which I admit I didn’t see was the same as one of the links I gave) clearly shows an animated icon there. At about 0:35. http://www.youtube.com/watch?v=yNcs-sS2nFU&t=0m32s (this link jumps to that part). The arrow has a little black line move down through it repeatedly. Seems like animation to me. Is that what you want?
Regardless, what Android version is that on? Maybe it’s something custom from T-Mobile, I don’t know, it’s just some video on YouTube.
You can create a custom view for the notification, for example: http://www.roman10.net/android-custom-notification-with-progress-bar/ You might be able to use a similar idea with an animation drawable (same SO question again) where Roman10’s got the default android image.
Edit
So in the end RemoteViews doesn’t support animation in the image resource as far as I can tell. But I figured out a way to work around that and it is possibly expensive, but I haven’t profiled it to see how the CPU usage is.
I started with the code at roman10 (link above) and made a couple of modifications.
yinyangAnim.xml + animation frame .png files
Add another thread creation to the start button click:
Add to ProgressBarNotificationActivity.onCreate()
And the private variable of course:
private AnimationDrawable yinyangAnimation;Pressing the start button in the app and viewing the notification shows the spinning yin-yang for me. I got the yin-yang at loadinfo.net and split it using ImageMagick command line (ubuntu).