1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Don't display "0" in the action bar if there are no unread messages

This commit is contained in:
cketti 2012-09-11 04:38:03 +02:00
parent ac8d1aa162
commit 3060fd063e
2 changed files with 14 additions and 2 deletions

View File

@ -150,7 +150,13 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
class AccountsHandler extends Handler {
private void setViewTitle() {
mActionBarTitle.setText(" " + getString(R.string.accounts_title));
mActionBarUnread.setText(String.valueOf(mUnreadMessageCount));
if (mUnreadMessageCount == 0) {
mActionBarUnread.setVisibility(View.GONE);
} else {
mActionBarUnread.setText(Integer.toString(mUnreadMessageCount));
mActionBarUnread.setVisibility(View.VISIBLE);
}
String operation = mListener.getOperation(Accounts.this, getTimeFormat());
operation.trim();

View File

@ -119,7 +119,13 @@ public class FolderList extends K9ListActivity implements OnNavigationListener {
runOnUiThread(new Runnable() {
public void run() {
mActionBarTitle.setText(getString(R.string.folders_title));
mActionBarUnread.setText(String.valueOf(mUnreadMessageCount));
if (mUnreadMessageCount == 0) {
mActionBarUnread.setVisibility(View.GONE);
} else {
mActionBarUnread.setText(Integer.toString(mUnreadMessageCount));
mActionBarUnread.setVisibility(View.VISIBLE);
}
String operation = mAdapter.mListener.getOperation(FolderList.this, getTimeFormat()).trim();
if (operation.length() < 1) {