mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-04 08:35:08 -05:00
Provide title bar display of next polling time
This commit is contained in:
parent
c12f720ba0
commit
23e5a132d4
@ -30,6 +30,9 @@
|
|||||||
<string name="status_processing_account">\u0020(Proc <xliff:g id="account">%s</xliff:g>:<xliff:g id="command">%s</xliff:g><xliff:g id="progress">%s</xliff:g>)</string>
|
<string name="status_processing_account">\u0020(Proc <xliff:g id="account">%s</xliff:g>:<xliff:g id="command">%s</xliff:g><xliff:g id="progress">%s</xliff:g>)</string>
|
||||||
<string name="folder_progress">\u0020<xliff:g id="completed">%s</xliff:g>/<xliff:g id="total">%s</xliff:g></string>
|
<string name="folder_progress">\u0020<xliff:g id="completed">%s</xliff:g>/<xliff:g id="total">%s</xliff:g></string>
|
||||||
|
|
||||||
|
<string name="status_next_poll">\u0020(Next poll @ <xliff:g id="nexttime">%s</xliff:g>)</string>
|
||||||
|
<string name="status_polling_off">\u0020(Polling off)</string>
|
||||||
|
|
||||||
<!-- Actions will be used as buttons and in menu items -->
|
<!-- Actions will be used as buttons and in menu items -->
|
||||||
<string name="next_action">Next</string> <!-- Used as part of a multi-step process -->
|
<string name="next_action">Next</string> <!-- Used as part of a multi-step process -->
|
||||||
<string name="okay_action">OK</string> <!-- User to confirm acceptance of dialog boxes, warnings, errors, etc. -->
|
<string name="okay_action">OK</string> <!-- User to confirm acceptance of dialog boxes, warnings, errors, etc. -->
|
||||||
|
@ -46,7 +46,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
|||||||
{
|
{
|
||||||
private void setViewTitle()
|
private void setViewTitle()
|
||||||
{
|
{
|
||||||
String dispString = mListener.formatHeader(Accounts.this, getString(R.string.accounts_title), mUnreadMessageCount);
|
String dispString = mListener.formatHeader(Accounts.this, getString(R.string.accounts_title), mUnreadMessageCount, getTimeFormat());
|
||||||
|
|
||||||
setTitle(dispString);
|
setTitle(dispString);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package com.fsck.k9.activity;
|
package com.fsck.k9.activity;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.fsck.k9.Account;
|
import com.fsck.k9.Account;
|
||||||
import com.fsck.k9.K9;
|
import com.fsck.k9.K9;
|
||||||
import com.fsck.k9.MessagingListener;
|
import com.fsck.k9.MessagingListener;
|
||||||
import com.fsck.k9.R;
|
import com.fsck.k9.R;
|
||||||
|
import com.fsck.k9.service.MailService;
|
||||||
|
|
||||||
public class ActivityListener extends MessagingListener
|
public class ActivityListener extends MessagingListener
|
||||||
{
|
{
|
||||||
@ -17,7 +20,7 @@ public class ActivityListener extends MessagingListener
|
|||||||
private String mProcessingAccountDescription = null;
|
private String mProcessingAccountDescription = null;
|
||||||
private String mProcessingCommandTitle = null;
|
private String mProcessingCommandTitle = null;
|
||||||
|
|
||||||
public String formatHeader(Context context, String activityPrefix, int unreadMessageCount)
|
public String formatHeader(Context context, String activityPrefix, int unreadMessageCount, DateFormat timeFormat)
|
||||||
{
|
{
|
||||||
String operation = null;
|
String operation = null;
|
||||||
String progress = null;
|
String progress = null;
|
||||||
@ -48,7 +51,15 @@ public class ActivityListener extends MessagingListener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
operation = "";
|
long nextPollTime = MailService.getNextPollTime();
|
||||||
|
if (nextPollTime != -1)
|
||||||
|
{
|
||||||
|
operation = context.getString(R.string.status_next_poll, timeFormat.format(nextPollTime));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
operation = context.getString(R.string.status_polling_off);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.getString(R.string.activity_header_format, activityPrefix,
|
return context.getString(R.string.activity_header_format, activityPrefix,
|
||||||
|
@ -74,7 +74,7 @@ public class FolderList extends K9ListActivity
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
String dispString = mAdapter.mListener.formatHeader(FolderList.this, getString(R.string.folder_list_title, mAccount.getDescription()), mUnreadMessageCount);
|
String dispString = mAdapter.mListener.formatHeader(FolderList.this, getString(R.string.folder_list_title, mAccount.getDescription()), mUnreadMessageCount, getTimeFormat());
|
||||||
|
|
||||||
|
|
||||||
setTitle(dispString);
|
setTitle(dispString);
|
||||||
|
@ -252,7 +252,7 @@ public class MessageList
|
|||||||
displayName = getString(R.string.special_mailbox_name_inbox);
|
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);
|
String dispString = mAdapter.mListener.formatHeader(MessageList.this, getString(R.string.message_list_title, mAccount.getDescription(), displayName), mUnreadMessageCount, getTimeFormat());
|
||||||
|
|
||||||
setTitle(dispString);
|
setTitle(dispString);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user