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:
parent
5b907c2d94
commit
5e0bbf18aa
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user