Dialog cleanups.
This commit is contained in:
parent
f2569b587a
commit
ef0c5b9138
2 changed files with 14 additions and 4 deletions
|
@ -25,9 +25,15 @@ public class ComboErrorHistoryDialog extends DialogFragment {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM. HH:mm");
|
||||
if (errors.isEmpty()) {
|
||||
text.setText("No errors. To retrieve the error history from the pump, long press the Refresh button.");
|
||||
text.setText("To retrieve the error history from the pump, long press the Refresh button.");
|
||||
} else {
|
||||
boolean first = true;
|
||||
for (PumpError error : errors) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(simpleDateFormat.format(error.timestamp));
|
||||
sb.append(" ");
|
||||
sb.append(error.message);
|
||||
|
@ -41,7 +47,6 @@ public class ComboErrorHistoryDialog extends DialogFragment {
|
|||
sb.append(error.errorCode);
|
||||
sb.append(")");
|
||||
}
|
||||
sb.append("\n");
|
||||
}
|
||||
text.setText(sb.toString());
|
||||
}
|
||||
|
|
|
@ -25,14 +25,19 @@ public class ComboTddHistoryDialog extends DialogFragment {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.");
|
||||
if (tdds.isEmpty()) {
|
||||
text.setText("No TDDs. To retrieve the TDD history from the pump, long press the Refresh button.");
|
||||
text.setText("To retrieve the TDD history from the pump, long press the Refresh button.");
|
||||
} else {
|
||||
boolean first = true;
|
||||
for (Tdd tdd : tdds) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
sb.append("\n");
|
||||
}
|
||||
sb.append(simpleDateFormat.format(tdd.timestamp));
|
||||
sb.append(" ");
|
||||
sb.append(String.format("%.1f", tdd.total));
|
||||
sb.append(" U");
|
||||
sb.append("\n");
|
||||
}
|
||||
text.setText(sb.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue