From 3060fd063e579238e4c81145e485a7321dd35414 Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 11 Sep 2012 04:38:03 +0200 Subject: [PATCH] Don't display "0" in the action bar if there are no unread messages --- src/com/fsck/k9/activity/Accounts.java | 8 +++++++- src/com/fsck/k9/activity/FolderList.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index 72979adc3..894aba136 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -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(); diff --git a/src/com/fsck/k9/activity/FolderList.java b/src/com/fsck/k9/activity/FolderList.java index 17f4a2571..4069032fc 100644 --- a/src/com/fsck/k9/activity/FolderList.java +++ b/src/com/fsck/k9/activity/FolderList.java @@ -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) {