option to enable wear/SMB notifications

This commit is contained in:
AdrianLxM 2018-02-14 15:02:04 +01:00
parent 7270b0b2f5
commit c821ef97d8
3 changed files with 9 additions and 1 deletions

View file

@ -197,7 +197,7 @@ public class WearPlugin implements PluginBase {
@Subscribe @Subscribe
public void onStatusEvent(final EventOverviewBolusProgress ev) { public void onStatusEvent(final EventOverviewBolusProgress ev) {
if(!ev.isSMB()) { if(!ev.isSMB()||SP.getBoolean("wear_notifySMB", false)) {
Intent intent = new Intent(ctx, WatchUpdaterService.class).setAction(WatchUpdaterService.ACTION_SEND_BOLUSPROGRESS); Intent intent = new Intent(ctx, WatchUpdaterService.class).setAction(WatchUpdaterService.ACTION_SEND_BOLUSPROGRESS);
intent.putExtra("progresspercent", ev.percent); intent.putExtra("progresspercent", ev.percent);
intent.putExtra("progressstatus", ev.status); intent.putExtra("progressstatus", ev.status);

View file

@ -929,5 +929,7 @@
<string name="let_temp_basal_run">Let current temp basal run</string> <string name="let_temp_basal_run">Let current temp basal run</string>
<string name="mute">Mute</string> <string name="mute">Mute</string>
<string name="nav_historybrowser">History browser</string> <string name="nav_historybrowser">History browser</string>
<string name="wear_notifysmb_title">Notify on SMB</string>
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
</resources> </resources>

View file

@ -30,6 +30,12 @@
android:key="wear_showbgi" android:key="wear_showbgi"
android:summary="@string/wear_showbgi_summary" android:summary="@string/wear_showbgi_summary"
android:title="@string/wear_showbgi_title" /> android:title="@string/wear_showbgi_title" />
<SwitchPreference
android:defaultValue="false"
android:key="wear_notifySMB"
android:summary="@string/wear_notifysmb_summary"
android:title="@string/wear_notifysmb_title" />
</PreferenceScreen> </PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>