use notification instead of toast
This commit is contained in:
parent
87c84da3d9
commit
b6714ae254
2 changed files with 12 additions and 3 deletions
|
@ -40,7 +40,10 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||||
import info.nightscout.androidaps.plugins.DanaR.History.DanaRNSHistorySync;
|
import info.nightscout.androidaps.plugins.DanaR.History.DanaRNSHistorySync;
|
||||||
import info.nightscout.androidaps.plugins.NSProfile.NSProfilePlugin;
|
import info.nightscout.androidaps.plugins.NSProfile.NSProfilePlugin;
|
||||||
import info.nightscout.androidaps.plugins.Objectives.ObjectivesPlugin;
|
import info.nightscout.androidaps.plugins.Objectives.ObjectivesPlugin;
|
||||||
|
import info.nightscout.androidaps.plugins.Overview.Notification;
|
||||||
import info.nightscout.androidaps.plugins.Overview.OverviewPlugin;
|
import info.nightscout.androidaps.plugins.Overview.OverviewPlugin;
|
||||||
|
import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification;
|
||||||
|
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
|
||||||
import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin;
|
import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin;
|
||||||
import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventNewSMS;
|
import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventNewSMS;
|
||||||
import info.nightscout.androidaps.plugins.SourceMM640g.SourceMM640gPlugin;
|
import info.nightscout.androidaps.plugins.SourceMM640g.SourceMM640gPlugin;
|
||||||
|
@ -253,10 +256,15 @@ public class DataService extends IntentService {
|
||||||
ConfigBuilderPlugin.nsClientVersionCode = bundles.getInt("nsclientversioncode"); // for ver 1.17 contains 117
|
ConfigBuilderPlugin.nsClientVersionCode = bundles.getInt("nsclientversioncode"); // for ver 1.17 contains 117
|
||||||
ConfigBuilderPlugin.nsClientVersionName = bundles.getString("nsclientversionname");
|
ConfigBuilderPlugin.nsClientVersionName = bundles.getString("nsclientversionname");
|
||||||
log.debug("Got versions: NSClient: " + ConfigBuilderPlugin.nsClientVersionName + " Nightscout: " + ConfigBuilderPlugin.nightscoutVersionName);
|
log.debug("Got versions: NSClient: " + ConfigBuilderPlugin.nsClientVersionName + " Nightscout: " + ConfigBuilderPlugin.nightscoutVersionName);
|
||||||
if (ConfigBuilderPlugin.nsClientVersionCode < 121)
|
if (ConfigBuilderPlugin.nsClientVersionCode < 121) {
|
||||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.unsupportedclientver));
|
Notification notification = new Notification(Notification.OLD_NSCLIENT, MainApp.sResources.getString(R.string.unsupportedclientver), Notification.URGENT);
|
||||||
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.showToastInUiThread(MainApp.instance().getApplicationContext(), MainApp.sResources.getString(R.string.unsupportedclientver));
|
MainApp.bus().post(new EventDismissNotification(Notification.OLD_NSCLIENT));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Notification notification = new Notification(Notification.OLD_NSCLIENT, MainApp.sResources.getString(R.string.unsupportedclientver), Notification.URGENT);
|
||||||
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
}
|
}
|
||||||
if (bundles.containsKey("status")) {
|
if (bundles.containsKey("status")) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -20,6 +20,7 @@ public class Notification {
|
||||||
public static final int PROFILE_NOT_SET_NOT_INITIALIZED = 5;
|
public static final int PROFILE_NOT_SET_NOT_INITIALIZED = 5;
|
||||||
public static final int FAILED_UDPATE_PROFILE = 6;
|
public static final int FAILED_UDPATE_PROFILE = 6;
|
||||||
public static final int BASAL_VALUE_BELOW_MINIMUM = 7;
|
public static final int BASAL_VALUE_BELOW_MINIMUM = 7;
|
||||||
|
public static final int OLD_NSCLIENT = 8;
|
||||||
|
|
||||||
public int id;
|
public int id;
|
||||||
public Date date;
|
public Date date;
|
||||||
|
|
Loading…
Reference in a new issue