I have a refresh menu item icon on my actionbar (from the ICS icon set) that I want to replace with a small indeterminateDrawable from the holo theme when it's clicked.
I've styled the IndeterminateProgress like this to use the smaller indeterminateDrawable than the default one :
<style name="IndeterminateProgress" parent="@android:style/Widget.ProgressBar.Small">
<item name="android:indeterminateDrawable">@drawable/progress_small_holo</item>
</style>
When clicking on my refresh button, I call
setSupportProgressBarIndeterminateVisibility(true);
This ensures that the small animating progress is shown in the actionbar alongside the refresh button.
What I would like to do is to replace the refresh menu item icon with the indeterminateDrawable. What would be the best approach to do that ?
I'm currently just hiding the refresh menu item icon when it's clicked and calling
setSupportProgressBarIndeterminateVisibility(true);
Because the indeterminateDrawable is smaller than the refresh menu item icon, it's positioned too far to the right (next to another menu item), where I would want it to simply be positioned where the refresh menu item icon was.
Is there an easy way to do that ?