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:
parent
b2289783a4
commit
65505c8145
@ -304,11 +304,10 @@ public class MessageList extends K9ListActivity implements
|
||||
private FontSizes mFontSizes = K9.getFontSizes();
|
||||
|
||||
private MenuItem mRefreshMenuItem;
|
||||
private View mActionBarProgressView;
|
||||
private View mCustomRefreshView;
|
||||
private ActionBarNavigationSpinner mNavigationSpinner;
|
||||
private ActionBar mActionBar;
|
||||
private ActionMode mActionMode;
|
||||
private View mActionBarProgressView;
|
||||
private Bundle mState = null;
|
||||
|
||||
/**
|
||||
@ -543,14 +542,10 @@ public class MessageList extends K9ListActivity implements
|
||||
return;
|
||||
}
|
||||
|
||||
if (mQueryString == null) {
|
||||
if (progress) {
|
||||
mActionBar.setCustomView(mActionBarProgressView);
|
||||
mRefreshMenuItem.setActionView(mActionBarProgressView);
|
||||
} else {
|
||||
mActionBar.setCustomView(mCustomRefreshView);
|
||||
}
|
||||
} else {
|
||||
|
||||
mRefreshMenuItem.setActionView(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,6 +666,8 @@ public class MessageList extends K9ListActivity implements
|
||||
context = this;
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mActionBarProgressView = getLayoutInflater().inflate(R.layout.actionbar_indeterminate_progress_actionview, null);
|
||||
|
||||
// need this for actionbar initialization
|
||||
mQueryString = getIntent().getStringExtra(EXTRA_QUERY);
|
||||
|
||||
@ -908,21 +905,7 @@ public class MessageList extends K9ListActivity implements
|
||||
}
|
||||
|
||||
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.setCustomView(mCustomRefreshView);
|
||||
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
|
||||
ActionBar.DISPLAY_SHOW_CUSTOM);
|
||||
mActionBar.setDisplayShowTitleEnabled(false);
|
||||
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
||||
mNavigationSpinner = ActionBarNavigationSpinner.getDefaultSpinner(this);
|
||||
@ -939,8 +922,6 @@ public class MessageList extends K9ListActivity implements
|
||||
mListView.addFooterView(getFooterView(mListView));
|
||||
|
||||
registerForContextMenu(mListView);
|
||||
|
||||
mActionBarProgressView = mInflater.inflate(R.layout.actionbar_indeterminate_progress, null);
|
||||
}
|
||||
|
||||
|
||||
@ -1474,6 +1455,10 @@ public class MessageList extends K9ListActivity implements
|
||||
onCompose();
|
||||
return true;
|
||||
}
|
||||
case R.id.check_mail: {
|
||||
checkMail(mAccount, mFolderName);
|
||||
return true;
|
||||
}
|
||||
case R.id.set_sort_date: {
|
||||
changeSort(SortType.SORT_DATE);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user