1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-16 06:25:06 -05:00

Remove customview from top bar and make bottom refresh function in MessageList.

This commit is contained in:
Sander Bogaert 2012-08-02 10:00:28 -04:00 committed by Andrew Chen
parent b2289783a4
commit 65505c8145

View File

@ -304,11 +304,10 @@ public class MessageList extends K9ListActivity implements
private FontSizes mFontSizes = K9.getFontSizes(); private FontSizes mFontSizes = K9.getFontSizes();
private MenuItem mRefreshMenuItem; private MenuItem mRefreshMenuItem;
private View mActionBarProgressView;
private View mCustomRefreshView;
private ActionBarNavigationSpinner mNavigationSpinner; private ActionBarNavigationSpinner mNavigationSpinner;
private ActionBar mActionBar; private ActionBar mActionBar;
private ActionMode mActionMode; private ActionMode mActionMode;
private View mActionBarProgressView;
private Bundle mState = null; private Bundle mState = null;
/** /**
@ -543,14 +542,10 @@ public class MessageList extends K9ListActivity implements
return; return;
} }
if (mQueryString == null) { if (progress) {
if (progress) { mRefreshMenuItem.setActionView(mActionBarProgressView);
mActionBar.setCustomView(mActionBarProgressView);
} else {
mActionBar.setCustomView(mCustomRefreshView);
}
} else { } else {
mRefreshMenuItem.setActionView(null);
} }
} }
@ -671,6 +666,8 @@ public class MessageList extends K9ListActivity implements
context = this; context = this;
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mActionBarProgressView = getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress_actionview, null);
// need this for actionbar initialization // need this for actionbar initialization
mQueryString = getIntent().getStringExtra(EXTRA_QUERY); mQueryString = getIntent().getStringExtra(EXTRA_QUERY);
@ -908,21 +905,7 @@ public class MessageList extends K9ListActivity implements
} }
private void initializeActionBar() { private void initializeActionBar() {
mCustomRefreshView = mInflater.inflate(R.layout.actionbar_top_custom, null);
ImageButton mCustomRefresh = (ImageButton) mCustomRefreshView.findViewById(R.id.actionbar_refresh_button);
mCustomRefresh.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mFolderName != null) {
checkMail(mAccount, mFolderName);
}
}
});
mActionBar.setDisplayHomeAsUpEnabled(true); mActionBar.setDisplayHomeAsUpEnabled(true);
mActionBar.setCustomView(mCustomRefreshView);
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
ActionBar.DISPLAY_SHOW_CUSTOM);
mActionBar.setDisplayShowTitleEnabled(false); mActionBar.setDisplayShowTitleEnabled(false);
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
mNavigationSpinner = ActionBarNavigationSpinner.getDefaultSpinner(this); mNavigationSpinner = ActionBarNavigationSpinner.getDefaultSpinner(this);
@ -939,8 +922,6 @@ public class MessageList extends K9ListActivity implements
mListView.addFooterView(getFooterView(mListView)); mListView.addFooterView(getFooterView(mListView));
registerForContextMenu(mListView); registerForContextMenu(mListView);
mActionBarProgressView = mInflater.inflate(R.layout.actionbar_indeterminate_progress, null);
} }
@ -1474,6 +1455,10 @@ public class MessageList extends K9ListActivity implements
onCompose(); onCompose();
return true; return true;
} }
case R.id.check_mail: {
checkMail(mAccount, mFolderName);
return true;
}
case R.id.set_sort_date: { case R.id.set_sort_date: {
changeSort(SortType.SORT_DATE); changeSort(SortType.SORT_DATE);
return true; return true;