Extract some string resources.
This commit is contained in:
parent
cc6c34e46c
commit
cf430b84cf
5 changed files with 19 additions and 15 deletions
|
@ -189,7 +189,9 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
FragmentManager manager = getChildFragmentManager();
|
FragmentManager manager = getFragmentManager();
|
||||||
|
// TODO this might fix some crashes ..., let's see if they re-appear with this disabled again
|
||||||
|
// FragmentManager manager = getChildFragmentManager();
|
||||||
final PumpInterface pump = MainApp.getConfigBuilder();
|
final PumpInterface pump = MainApp.getConfigBuilder();
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.actions_profileswitch:
|
case R.id.actions_profileswitch:
|
||||||
|
|
|
@ -7,7 +7,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.jotomo.ruffy.spi.history.PumpAlert;
|
import de.jotomo.ruffy.spi.history.PumpAlert;
|
||||||
|
@ -20,10 +20,9 @@ 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;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
// TODO i18n
|
DateFormat dateFormatter = DateFormat.getDateInstance();
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM. HH:mm");
|
|
||||||
if (errors.isEmpty()) {
|
if (errors.isEmpty()) {
|
||||||
text.setText("To retrieve the alert history from the pump, long press the Refresh button.");
|
text.setText(R.string.combo_empty_alert_history_note);
|
||||||
} else {
|
} else {
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (PumpAlert error : errors) {
|
for (PumpAlert error : errors) {
|
||||||
|
@ -32,7 +31,7 @@ public class ComboAlertHistoryDialog extends DialogFragment {
|
||||||
} else {
|
} else {
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
}
|
}
|
||||||
sb.append(simpleDateFormat.format(error.timestamp));
|
sb.append(dateFormatter.format(error.timestamp));
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
sb.append(error.message);
|
sb.append(error.message);
|
||||||
if (error.warningCode != null) {
|
if (error.warningCode != null) {
|
||||||
|
|
|
@ -691,7 +691,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
int minutesOfDayNow = now.getHours() * 60 + now.getMinutes();
|
int minutesOfDayNow = now.getHours() * 60 + now.getMinutes();
|
||||||
if ((Math.abs(preCheckResult.state.pumpTimeMinutesOfDay - minutesOfDayNow) > 3)) {
|
if ((Math.abs(preCheckResult.state.pumpTimeMinutesOfDay - minutesOfDayNow) > 3)) {
|
||||||
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, "Check pump clock", Notification.NORMAL);
|
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_notification_check_time_date), Notification.NORMAL);
|
||||||
MainApp.bus().post(new EventNewNotification(notification));
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
// runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime);
|
// runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime);
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
closedLoopDisabledUntil = lastViolation + 6 * 60 * 60 * 1000;
|
closedLoopDisabledUntil = lastViolation + 6 * 60 * 60 * 1000;
|
||||||
if (closedLoopDisabledUntil > System.currentTimeMillis() && violationWarningRaisedFor != closedLoopDisabledUntil) {
|
if (closedLoopDisabledUntil > System.currentTimeMillis() && violationWarningRaisedFor != closedLoopDisabledUntil) {
|
||||||
Notification n = new Notification(Notification.COMBO_PUMP_ALARM,
|
Notification n = new Notification(Notification.COMBO_PUMP_ALARM,
|
||||||
MainApp.sResources.getString(R.string.combo_force_disabled),
|
MainApp.sResources.getString(R.string.combo_force_disabled_notification),
|
||||||
Notification.URGENT);
|
Notification.URGENT);
|
||||||
n.soundId = R.raw.alarm;
|
n.soundId = R.raw.alarm;
|
||||||
MainApp.bus().post(new EventNewNotification(n));
|
MainApp.bus().post(new EventNewNotification(n));
|
||||||
|
|
|
@ -7,7 +7,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.DateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.jotomo.ruffy.spi.history.Tdd;
|
import de.jotomo.ruffy.spi.history.Tdd;
|
||||||
|
@ -20,10 +20,9 @@ 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;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
// TODO i18n
|
DateFormat dateFormatter = DateFormat.getDateInstance();
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd.MM.");
|
|
||||||
if (tdds.isEmpty()) {
|
if (tdds.isEmpty()) {
|
||||||
text.setText("To retrieve the TDD history from the pump, long press the Refresh button.");
|
text.setText(R.string.combo_empty_tdd_history_note);
|
||||||
} else {
|
} else {
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (Tdd tdd : tdds) {
|
for (Tdd tdd : tdds) {
|
||||||
|
@ -32,8 +31,9 @@ public class ComboTddHistoryDialog extends DialogFragment {
|
||||||
} else {
|
} else {
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
}
|
}
|
||||||
sb.append(simpleDateFormat.format(tdd.timestamp));
|
sb.append(dateFormatter.format(tdd.timestamp));
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
|
// TODO i18n
|
||||||
sb.append(String.format("%.1f", tdd.total));
|
sb.append(String.format("%.1f", tdd.total));
|
||||||
sb.append(" U");
|
sb.append(" U");
|
||||||
}
|
}
|
||||||
|
|
|
@ -771,6 +771,7 @@
|
||||||
<string name="combo_last_connection_time">%s</string>
|
<string name="combo_last_connection_time">%s</string>
|
||||||
<string name="combo_tbr_remaining">%d%% (%d min remaining)</string>
|
<string name="combo_tbr_remaining">%d%% (%d min remaining)</string>
|
||||||
<string name="combo_last_bolus">%.1f U (%s, %s)</string>
|
<string name="combo_last_bolus">%.1f U (%s, %s)</string>
|
||||||
|
<string name="combo_pump_action_initializing">Initializing</string>
|
||||||
<string name="combo_pump_state_disconnected">Disconnected</string>
|
<string name="combo_pump_state_disconnected">Disconnected</string>
|
||||||
<string name="combo_pump_state_suspended_due_to_error">Suspended due to error</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_suspended_by_user">Suspended by user</string>
|
||||||
|
@ -788,9 +789,9 @@
|
||||||
<string name="combo_pump_bolus_verification_failed">Bolus delivery verification failed. The pump history will be read again on the next loop run or when refreshing from the Combo page. Please check and bolus again if needed.</string>
|
<string name="combo_pump_bolus_verification_failed">Bolus delivery verification failed. The pump history will be read again on the next loop run or when refreshing from the Combo page. Please check and bolus again if needed.</string>
|
||||||
<string name="combo_pump_unsupported_operation">Requested operation not supported by pump</string>
|
<string name="combo_pump_unsupported_operation">Requested operation not supported by pump</string>
|
||||||
<string name="combo_bolus_bolus_delivery_failed">Bolus delivery failed. A (partial) bolus might have been delivered. Attempting to update history from pump. Please check the Combo page and bolus again as needed.</string>
|
<string name="combo_bolus_bolus_delivery_failed">Bolus delivery failed. A (partial) bolus might have been delivered. Attempting to update history from pump. Please check the Combo page and bolus again as needed.</string>
|
||||||
<string name="combo_force_disabled">Unsafe usage: extended or multiwave boluses have been delivered within the last 6 hours or the selected basal rate is not 1. Loop mode has been disabled until 6 hours after the last unsupported bolus or basal rate profile. Only normal boluses are supported in loop mode with basal rate profile 1.</string>
|
<string name="combo_force_disabled_notification">Unsafe usage: extended or multiwave boluses have been delivered within the last 6 hours or the selected basal rate is not 1. Loop mode has been disabled until 6 hours after the last unsupported bolus or basal rate profile. Only normal boluses are supported in loop mode with basal rate profile 1.</string>
|
||||||
|
<string name="combo_notification_check_time_date">Check pump time and date</string>
|
||||||
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last minute. For safety reasons this is disallowed.</string>
|
<string name="bolus_frequency_exceeded">A bolus with the same amount was requested within the last minute. For safety reasons this is disallowed.</string>
|
||||||
<string name="combo_pump_action_initializing">Initializing</string>
|
|
||||||
<string name="combo_pump_connected_now">Now</string>
|
<string name="combo_pump_connected_now">Now</string>
|
||||||
<string name="combo_activity_reading_pump_history">Reading pump history</string>
|
<string name="combo_activity_reading_pump_history">Reading pump history</string>
|
||||||
<string name="danar_history">pump history</string>
|
<string name="danar_history">pump history</string>
|
||||||
|
@ -813,5 +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.</string>
|
||||||
|
<string name="combo_empty_tdd_history_note">To retrieve the TDD history from the pump, long press the Refresh button.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue