android - How to show Indeterminate Progress bar when Refresh button is pressed in ActionBarSherlock? -


how show indeterminate progressbar when refresh button pressed in actionbarsherlock , again show refresh button when viewgroup on refreshed?

update 1: have answer here incomplete. placing bounty on question more developers can build answer can useful others in future.

how can show indeterminate progressbar looks 1 shown in image belowenter image description here

it seems actionbarsherlock doesn't provide specific method animate refresh menuitem.

what can (by using classic android api) use setactionview(int resid) method , give id of layout progressbar in it.

at beginning of refresh action call :

item.setactionview(r.layout.refresh_menuitem); 

and when refresh action finished call :

item.setactionview(null); 

here sample of layout file refresh_menuitem.xml can have :

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"               android:layout_width="wrap_content"               android:layout_height="wrap_content"               android:addstatesfromchildren="true"               android:focusable="true"               android:paddingleft="4dp"               android:paddingright="4dp"               android:gravity="center"               style="?attr/actionbuttonstyle">     <progressbar             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:focusable="true"             style="@android:style/widget.progressbar.small"/> </linearlayout>  

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -