draw profile in dana profile viewer

This commit is contained in:
AdrianLxM 2018-03-15 16:56:59 +01:00
parent d31c9a6ed6
commit b481e77008
2 changed files with 6 additions and 2 deletions

View file

@ -26,6 +26,7 @@ import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin;
import info.nightscout.androidaps.plugins.Treatments.fragments.ProfileGraph;
import info.nightscout.utils.DecimalFormatter;
/**
@ -42,6 +43,8 @@ public class ProfileViewDialog extends DialogFragment {
private TextView isf;
private TextView basal;
private TextView target;
private ProfileGraph basalGraph;
private Button refreshButton;
@ -70,7 +73,7 @@ public class ProfileViewDialog extends DialogFragment {
dismiss();
}
});
basalGraph = (ProfileGraph) layout.findViewById(R.id.basal_graph);
setContent();
return layout;
}
@ -90,6 +93,7 @@ public class ProfileViewDialog extends DialogFragment {
// }
ProfileStore store = ((ProfileInterface)MainApp.getConfigBuilder().getActivePump()).getProfile();
if (store != null) {
store.getDefaultProfile();
noProfile.setVisibility(View.GONE);
Profile profile = store.getDefaultProfile();
units.setText(profile.getUnits());
@ -99,6 +103,7 @@ public class ProfileViewDialog extends DialogFragment {
isf.setText(profile.getIsfList());
basal.setText(profile.getBasalList());
target.setText(profile.getTargetList());
basalGraph.show(store.getDefaultProfile());
} else {
noProfile.setVisibility(View.VISIBLE);
}

View file

@ -90,7 +90,6 @@ public class ProfileViewerDialog extends DialogFragment {
@Override
public void onResume() {
super.onResume();
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.height = ViewGroup.LayoutParams.MATCH_PARENT;