'Refresh all feeds'-menuitem is now invisible while refreshing feeds

This commit is contained in:
daniel oeh 2012-06-26 13:24:57 +02:00
parent 6488e79827
commit 8965e3ea37

View File

@ -109,6 +109,7 @@ public class PodfetcherActivity extends SherlockFragmentActivity {
} else {
setSupportProgressBarIndeterminateVisibility(false);
}
invalidateOptionsMenu();
}
@Override
@ -134,6 +135,17 @@ public class PodfetcherActivity extends SherlockFragmentActivity {
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem refreshAll = menu.findItem(R.id.all_feed_refresh);
if (DownloadService.isRunning && DownloadRequester.getInstance().isDownloadingFeeds()) {
refreshAll.setVisible(false);
} else {
refreshAll.setVisible(true);
}
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = new MenuInflater(this);