Merge pull request #256 from jotomo/accempt-temp-clears-notification

Clear notification when accepting temp basal.
This commit is contained in:
Milos Kozak 2017-06-08 16:32:44 +02:00 committed by GitHub
commit 458989d042

View file

@ -2,8 +2,9 @@ package info.nightscout.androidaps.plugins.Overview;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
@ -576,6 +577,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
@Override
public void run() {
hideTempRecommendation();
clearNotification();
PumpEnactResult applyResult = MainApp.getConfigBuilder().applyAPSRequest(finalLastRun.constraintsProcessed);
if (applyResult.enacted) {
finalLastRun.setByPump = applyResult;
@ -804,6 +806,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
});
}
private void clearNotification() {
NotificationManager notificationManager =
(NotificationManager) MainApp.instance().getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.notificationID);
}
private void updatePumpStatus(String status) {
if (!status.equals("")) {
pumpStatusView.setText(status);