Clean up ComboFragment, related string resources.

This commit is contained in:
Johannes Mockenhaupt 2017-10-28 00:47:45 +02:00
parent c53936a7ac
commit 36d5c4d806
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
3 changed files with 4 additions and 8 deletions

View file

@ -85,8 +85,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
}
public void updateGUI() {
final Activity activity = getActivity();
log.debug("aCtI: activity available? " + (activity != null));
Activity activity = getActivity();
if (activity != null)
activity.runOnUiThread(new Runnable() {
@Override
@ -95,7 +94,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
// activity
String activity = plugin.getPump().activity;
activityView.setText(activity != null ? activity : "");
activityView.setText(activity != null ? activity : getString(R.string.combo_action_idle));
if (plugin.isInitialized()) {
// state
@ -140,8 +139,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
if (lastCmdResult != null) {
String minAgo = DateUtil.minAgo(lastCmdResult.completionTime);
String time = DateUtil.timeString(lastCmdResult.completionTime);
// TODO must not be within if (lastCmdResult) so we can complain if NO command ever worked; also move from completionTime to new times
// TODO check all access to completionTime. useful anymore?
if (plugin.getPump().lastSuccessfulConnection < System.currentTimeMillis() + 30 * 60 * 1000) {
lastConnectionView.setText(getString(R.string.combo_no_pump_connection, minAgo));
lastConnectionView.setTextColor(Color.RED);

View file

@ -688,8 +688,6 @@
<string name="combo_pump_state_suspended_by_user">Durch Benuzter gestoppt</string>
<string name="combo_pump_state_suspended_due_to_error">Wegen Fehler gestoppt</string>
<string name="combo_pump_state_running">Normaler Betrieb</string>
<string name="combo_last_bolus">Letzter Bolus</string>
<string name="combo_last_connection_time">Letzte Verbindung</string>
<string name="combo_stats">Statistiken</string>
<string name="combo_programming_bolus">Bolusabgabe wird vorbereitet</string>
<string name="combo_action_refreshing">Aktualisierung</string>

View file

@ -767,7 +767,7 @@
<string name="combo_last_connection_time">%s (%s)</string>
<string name="combo_tbr_remaining">%d%% (%d remaining)</string>
<string name="combo_last_bolus">%.2f U (%.1f %s, %s)</string>
<string name="combo_pump_state_unreachable">Unreachable</string>
<string name="combo_pump_state_unreachable">Pump unreachable</string>
<string name="combo_pump_state_suspended_due_to_error">Suspended due to error</string>
<string name="combo_pump_state_suspended_by_user">Suspended by user</string>
<string name="combo_pump_state_running">Running</string>
@ -775,5 +775,6 @@
<string name="combo_action_cancelling_tbr">Cancelling TBR</string>
<string name="combo_action_setting_tbr">Setting TBR</string>
<string name="combo_action_bolusing">Bolusing</string>
<string name="combo_action_idle">Idle</string>
</resources>