diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorDialog.java
index f11283c029..7d45c35792 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorDialog.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorDialog.java
@@ -19,6 +19,7 @@ import info.nightscout.androidaps.Services.AlarmSoundService;
public class ErrorDialog extends DialogFragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(ErrorDialog.class);
+ Button muteButton;
Button okButton;
TextView statusView;
ErrorHelperActivity helperActivity;
@@ -52,14 +53,14 @@ public class ErrorDialog extends DialogFragment implements View.OnClickListener
Bundle savedInstanceState) {
getDialog().setTitle(title);
View view = inflater.inflate(R.layout.overview_error_dialog, container, false);
+ muteButton = (Button) view.findViewById(R.id.overview_error_mute);
okButton = (Button) view.findViewById(R.id.overview_error_ok);
statusView = (TextView) view.findViewById(R.id.overview_error_status);
+ muteButton.setOnClickListener(this);
okButton.setOnClickListener(this);
setCancelable(false);
- Intent alarm = new Intent(MainApp.instance().getApplicationContext(), AlarmSoundService.class);
- alarm.putExtra("soundid", soundId);
- MainApp.instance().startService(alarm);
+ startAlarm();
return view;
}
@@ -77,13 +78,16 @@ public class ErrorDialog extends DialogFragment implements View.OnClickListener
if (helperActivity != null) {
helperActivity.finish();
}
- Intent alarm = new Intent(MainApp.instance().getApplicationContext(), AlarmSoundService.class);
- MainApp.instance().stopService(alarm);
+ stopAlarm();
}
@Override
public void onClick(View view) {
switch (view.getId()) {
+ case R.id.overview_error_mute:
+ log.debug("Error dialog mute button pressed");
+ stopAlarm();
+ break;
case R.id.overview_error_ok:
log.debug("Error dialog ok button pressed");
dismiss();
@@ -91,4 +95,14 @@ public class ErrorDialog extends DialogFragment implements View.OnClickListener
}
}
+ private void startAlarm() {
+ Intent alarm = new Intent(MainApp.instance().getApplicationContext(), AlarmSoundService.class);
+ alarm.putExtra("soundid", soundId);
+ MainApp.instance().startService(alarm);
+ }
+
+ private void stopAlarm() {
+ Intent alarm = new Intent(MainApp.instance().getApplicationContext(), AlarmSoundService.class);
+ MainApp.instance().stopService(alarm);
+ }
}
diff --git a/app/src/main/res/layout/overview_error_dialog.xml b/app/src/main/res/layout/overview_error_dialog.xml
index a34f41fb5a..6478c24784 100644
--- a/app/src/main/res/layout/overview_error_dialog.xml
+++ b/app/src/main/res/layout/overview_error_dialog.xml
@@ -16,11 +16,19 @@
android:layout_gravity="center_horizontal" />
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f3e4b534c4..3c2318c94f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -875,5 +875,6 @@
Basal rate changed on pump, but reading it failed
Checking for history changes
Multiple boluses with the same amount within the same minute were just imported. Only one record could be added to treatments. Please check the pump and manually add a bolus record using the Careportal tab. Make sure to create a bolus with a time no other bolus uses.
+ Mute