ComboFragment: move forced history read to long-pressing the TDD button.
To avoid accidentally doing this when a short press on Refresh was intended.
This commit is contained in:
parent
fe40ebd4a5
commit
141c116db6
4 changed files with 5 additions and 6 deletions
|
@ -20,7 +20,7 @@ public class ComboAlertHistoryDialog extends DialogFragment {
|
||||||
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
|
TextView text = (TextView) layout.findViewById(R.id.combo_error_history_text);
|
||||||
List<PumpAlert> errors = ComboPlugin.getPlugin().getPump().errorHistory;
|
List<PumpAlert> errors = ComboPlugin.getPlugin().getPump().errorHistory;
|
||||||
if (errors.isEmpty()) {
|
if (errors.isEmpty()) {
|
||||||
text.setText(R.string.combo_empty_alert_history_note);
|
text.setText(R.string.combo_empty_history_note);
|
||||||
} else {
|
} else {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View view) {
|
public boolean onLongClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.combo_refresh:
|
case R.id.combo_tdd_history:
|
||||||
new Thread(() -> ComboPlugin.getPlugin().readAllPumpData()).start();
|
new Thread(() -> ComboPlugin.getPlugin().readAllPumpData()).start();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
|
||||||
lastConnectionView.setTextColor(Color.WHITE);
|
lastConnectionView.setTextColor(Color.WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* triggers pump bug
|
/* reading the data that would be displayed here triggers pump bug
|
||||||
// last bolus
|
// last bolus
|
||||||
Bolus bolus = plugin.getPump().lastBolus;
|
Bolus bolus = plugin.getPump().lastBolus;
|
||||||
if (bolus != null && bolus.timestamp + 6 * 60 * 60 * 1000 >= System.currentTimeMillis()) {
|
if (bolus != null && bolus.timestamp + 6 * 60 * 60 * 1000 >= System.currentTimeMillis()) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class ComboTddHistoryDialog extends DialogFragment {
|
||||||
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
|
TextView text = (TextView) layout.findViewById(R.id.combo_tdd_history_text);
|
||||||
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().tddHistory;
|
List<Tdd> tdds = ComboPlugin.getPlugin().getPump().tddHistory;
|
||||||
if (tdds.isEmpty()) {
|
if (tdds.isEmpty()) {
|
||||||
text.setText(R.string.combo_empty_tdd_history_note);
|
text.setText(R.string.combo_empty_history_note);
|
||||||
} else {
|
} else {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
DateFormat dateFormatter = DateFormat.getDateInstance();
|
DateFormat dateFormatter = DateFormat.getDateInstance();
|
||||||
|
|
|
@ -814,8 +814,7 @@
|
||||||
<string name="key_missed_bg_readings_threshold" translatable="false">missed_bg_readings_threshold</string>
|
<string name="key_missed_bg_readings_threshold" translatable="false">missed_bg_readings_threshold</string>
|
||||||
<string name="urgent_alarm">Urgent Alarm</string>
|
<string name="urgent_alarm">Urgent Alarm</string>
|
||||||
<string name="info">INFO</string>
|
<string name="info">INFO</string>
|
||||||
<string name="combo_empty_alert_history_note">To retrieve the alert history from the pump, long press the Refresh button. NOTE: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
|
<string name="combo_empty_history_note">To read all data from the pump, long press the Stats button.\n\nWARNING: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
|
||||||
<string name="combo_empty_tdd_history_note">To retrieve the TDD history from the pump, long press the Refresh button. NOTE: this can trigger a bug which causes the pump to reject all connection attempts and requires pressing a button on the pump to recover and should therefore be avoided.</string>
|
|
||||||
<string name="key_sync_profile_to_pump">sync_profile_to_pump</string>
|
<string name="key_sync_profile_to_pump">sync_profile_to_pump</string>
|
||||||
<string name="combo_tdd_minimum">Minimum: %3.1f U</string>
|
<string name="combo_tdd_minimum">Minimum: %3.1f U</string>
|
||||||
<string name="combo_tdd_average">Average: %3.1f U</string>
|
<string name="combo_tdd_average">Average: %3.1f U</string>
|
||||||
|
|
Loading…
Reference in a new issue