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

Extract parts of title setting code into their own methods

This commit is contained in:
Jesse Vincent 2009-12-27 16:51:19 +00:00
parent 5b907c2d94
commit 5e0bbf18aa

View File

@ -228,14 +228,16 @@ public class MessageList
{ {
public void run() public void run()
{ {
String displayName = mFolderName; setWindowTitle();
if (K9.INBOX.equalsIgnoreCase(displayName)) setWindowProgress();
{ }
displayName = getString(R.string.special_mailbox_name_inbox); });
} }
String dispString = mAdapter.mListener.formatHeader(MessageList.this, getString(R.string.message_list_title, mAccount.getDescription(), displayName), mUnreadMessageCount);
setTitle(dispString); private void setWindowProgress()
{
int level = Window.PROGRESS_END; int level = Window.PROGRESS_END;
if (mCurrentFolder.loading && mAdapter.mListener.getFolderTotal() > 0) if (mCurrentFolder.loading && mAdapter.mListener.getFolderTotal() > 0)
{ {
@ -248,8 +250,27 @@ public class MessageList
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, level); getWindow().setFeatureInt(Window.FEATURE_PROGRESS, level);
} }
}); private void setWindowTitle()
{
String displayName;
if (mFolderName != null)
{
displayName = mFolderName;
if (K9.INBOX.equalsIgnoreCase(displayName))
{
displayName = getString(R.string.special_mailbox_name_inbox);
} }
String dispString = mAdapter.mListener.formatHeader(MessageList.this, getString(R.string.message_list_title, mAccount.getDescription(), displayName), mUnreadMessageCount);
setTitle(dispString);
}
}
public void progress(final boolean progress) public void progress(final boolean progress)
{ {
runOnUiThread(new Runnable() runOnUiThread(new Runnable()