1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-31 07:10:14 -05: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()
{
String displayName = mFolderName;
if (K9.INBOX.equalsIgnoreCase(displayName))
{
displayName = getString(R.string.special_mailbox_name_inbox);
setWindowTitle();
setWindowProgress();
}
});
}
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;
if (mCurrentFolder.loading && mAdapter.mListener.getFolderTotal() > 0)
{
@ -248,8 +250,27 @@ public class MessageList
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)
{
runOnUiThread(new Runnable()