G6 overview button support

This commit is contained in:
Milos Kozak 2018-12-01 00:26:04 +01:00
parent 946b2bfd12
commit d664136b6e
2 changed files with 8 additions and 2 deletions

View file

@ -108,6 +108,7 @@ import info.nightscout.androidaps.plugins.Overview.graphData.GraphData;
import info.nightscout.androidaps.plugins.Overview.notifications.NotificationRecyclerViewAdapter;
import info.nightscout.androidaps.plugins.Overview.notifications.NotificationStore;
import info.nightscout.androidaps.plugins.Source.SourceDexcomG5Plugin;
import info.nightscout.androidaps.plugins.Source.SourceDexcomG6Plugin;
import info.nightscout.androidaps.plugins.Source.SourceXdripPlugin;
import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin;
import info.nightscout.androidaps.plugins.Treatments.fragments.ProfileViewerDialog;
@ -646,6 +647,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
public void onClick(View v) {
boolean xdrip = SourceXdripPlugin.getPlugin().isEnabled(PluginType.BGSOURCE);
boolean g5 = SourceDexcomG5Plugin.getPlugin().isEnabled(PluginType.BGSOURCE);
boolean g6 = SourceDexcomG6Plugin.getPlugin().isEnabled(PluginType.BGSOURCE);
String units = ProfileFunctions.getInstance().getProfileUnits();
FragmentManager manager = getFragmentManager();
@ -668,7 +670,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (xdrip) {
CalibrationDialog calibrationDialog = new CalibrationDialog();
calibrationDialog.show(manager, "CalibrationDialog");
} else if (g5) {
} else if (g5 || g6) {
try {
Intent i = new Intent("com.dexcom.cgm.activities.MeterEntryActivity");
startActivity(i);
@ -684,6 +686,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
openCgmApp("com.dexcom.cgm.region5.mgdl");
else if (g5 && units.equals(Constants.MMOL))
openCgmApp("com.dexcom.cgm.region5.mmol");
else if (g6 && units.equals(Constants.MGDL))
openCgmApp("com.dexcom.g6.region3.mgdl");
else if (g6 && units.equals(Constants.MMOL))
openCgmApp("com.dexcom.g6.region3.mmol");
break;
case R.id.overview_treatmentbutton:
NewTreatmentDialog treatmentDialogFragment = new NewTreatmentDialog();

View file

@ -968,7 +968,7 @@
<string name="data_choices">Data Choices</string>
<string name="fabric_upload">Fabric Upload</string>
<string name="allow_automated_crash_reporting">Allow automated crash reporting and feature usage data to be sent to the developers via the fabric.io service.</string>
<string name="g5appnotdetected">Please update your G5 app to supported version</string>
<string name="g5appnotdetected">Please update your Dexcom app to supported version</string>
<string name="start_activity_tt">Start Activity TT</string>
<string name="start_eating_soon_tt">Start Eating soon TT</string>
<string name="temptargetshort">TT</string>