Merge pull request #233 from Philoul/Wear_String_BolusProgress

Wear : Add String for Bolus Progress / Cancel Button
This commit is contained in:
Milos Kozak 2021-01-15 09:56:11 +01:00 committed by GitHub
commit fda2bb6188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -37,6 +37,7 @@ import com.google.android.gms.wearable.WearableListenerService;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import info.nightscout.androidaps.aaps;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interaction.AAPSPreferences; import info.nightscout.androidaps.interaction.AAPSPreferences;
import info.nightscout.androidaps.interaction.actions.AcceptActivity; import info.nightscout.androidaps.interaction.actions.AcceptActivity;
@ -635,13 +636,13 @@ public class ListenerService extends WearableListenerService implements GoogleAp
NotificationCompat.Builder notificationBuilder = NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this, AAPS_NOTIFY_CHANNEL_ID_BOLUSPROGRESS) new NotificationCompat.Builder(this, AAPS_NOTIFY_CHANNEL_ID_BOLUSPROGRESS)
.setSmallIcon(R.drawable.ic_icon) .setSmallIcon(R.drawable.ic_icon)
.setContentTitle("Bolus Progress") .setContentTitle(aaps.gs(R.string.bolus_progress))
.setContentText(progresspercent + "% - " + progresstatus) .setContentText(progresspercent + "% - " + progresstatus)
.setSubText("press to cancel") .setSubText(aaps.gs(R.string.press_to_cancel))
.setContentIntent(cancelPendingIntent) .setContentIntent(cancelPendingIntent)
.setPriority(NotificationCompat.PRIORITY_MAX) .setPriority(NotificationCompat.PRIORITY_MAX)
.setVibrate(vibratePattern) .setVibrate(vibratePattern)
.addAction(R.drawable.ic_cancel, "CANCEL BOLUS", cancelPendingIntent); .addAction(R.drawable.ic_cancel, aaps.gs(R.string.cancel_bolus), cancelPendingIntent);
NotificationManagerCompat notificationManager = NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this); NotificationManagerCompat.from(this);

View file

@ -100,6 +100,9 @@
<string name="action_timeshift">timeshift</string> <string name="action_timeshift">timeshift</string>
<string name="action_bolus">bolus</string> <string name="action_bolus">bolus</string>
<string name="bolus_progress">Bolus Progress</string>
<string name="press_to_cancel">press to cancel</string>
<string name="cancel_bolus">CANCEL BOLUS</string>
<string name="status_pump">Pump</string> <string name="status_pump">Pump</string>
<string name="status_loop">Loop</string> <string name="status_loop">Loop</string>