android: show rpc backup message in Projects tab only in advanced mode.

This commit is contained in:
Joachim Fritzsch 2013-07-09 10:48:35 +02:00
parent d47d4954ff
commit 0630e3d5a0
1 changed files with 12 additions and 9 deletions

View File

@ -124,15 +124,18 @@ public class ProjectsListAdapter extends ArrayAdapter<ProjectData> {
appendToStatus(sb, activity.getResources().getString(R.string.projects_status_trickleuppending));
}
Calendar minRPCTime = Calendar.getInstance();
Calendar now = Calendar.getInstance();
minRPCTime.setTimeInMillis((long)project.min_rpc_time*1000);
if (minRPCTime.compareTo(now) > 0) {
appendToStatus(
sb,
activity.getResources().getString(R.string.projects_status_backoff) + " " +
DateUtils.formatElapsedTime((minRPCTime.getTimeInMillis() - now.getTimeInMillis()) / 1000)
);
// show rpc backoff only in advanced mode
if(Monitor.getAppPrefs().getShowAdvanced()) {
Calendar minRPCTime = Calendar.getInstance();
Calendar now = Calendar.getInstance();
minRPCTime.setTimeInMillis((long)project.min_rpc_time*1000);
if (minRPCTime.compareTo(now) > 0) {
appendToStatus(
sb,
activity.getResources().getString(R.string.projects_status_backoff) + " " +
DateUtils.formatElapsedTime((minRPCTime.getTimeInMillis() - now.getTimeInMillis()) / 1000)
);
}
}
return sb.toString();