diff --git a/res/layout/action_bar_indeterminate_progress.xml b/res/layout/action_bar_indeterminate_progress.xml new file mode 100644 index 000000000..c36c79266 --- /dev/null +++ b/res/layout/action_bar_indeterminate_progress.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/src/com/android/email/activity/MessageListXL.java b/src/com/android/email/activity/MessageListXL.java index 79ba623c9..2c4a185c8 100644 --- a/src/com/android/email/activity/MessageListXL.java +++ b/src/com/android/email/activity/MessageListXL.java @@ -45,7 +45,6 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.Window; import android.widget.TextView; import java.security.InvalidParameterException; @@ -151,7 +150,6 @@ public class MessageListXL extends Activity implements if (Email.DEBUG_LIFECYCLE && Email.DEBUG) Log.d(Email.LOG_TAG, "MessageListXL onCreate"); super.onCreate(savedInstanceState); ActivityHelper.debugSetWindowFlags(this); - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.message_list_xl); ActionBar ab = getActionBar(); @@ -703,7 +701,7 @@ public class MessageListXL extends Activity implements * If we're refreshing the current mailbox, animate the "mailbox refreshing" progress icon. */ private void updateProgressIcon() { - setProgressBarIndeterminateVisibility(isProgressActive()); + invalidateOptionsMenu(); } private boolean isProgressActive() { @@ -723,6 +721,12 @@ public class MessageListXL extends Activity implements MenuItem item = menu.findItem(R.id.refresh); if (item != null) { item.setVisible(shouldShowRefreshButton()); + if (isProgressActive()) { + // Turn it into a progress icon. + item.setActionView(R.layout.action_bar_indeterminate_progress); + } else { + item.setActionView(null); + } } return super.onPrepareOptionsMenu(menu); }