Merge pull request #373 from MilosKozak/profile-switch-viewer

Profile switch viewer update
This commit is contained in:
AdrianLxM 2017-08-17 21:49:06 +02:00 committed by GitHub
commit 6c8e957a33
2 changed files with 22 additions and 27 deletions

View file

@ -33,16 +33,16 @@ import info.nightscout.utils.DecimalFormatter;
public class ProfileViewDialog extends DialogFragment {
private static Logger log = LoggerFactory.getLogger(ProfileViewDialog.class);
private static TextView noProfile;
private static TextView units;
private static TextView dia;
private static TextView activeProfile;
private static TextView ic;
private static TextView isf;
private static TextView basal;
private static TextView target;
private TextView noProfile;
private TextView units;
private TextView dia;
private TextView activeProfile;
private TextView ic;
private TextView isf;
private TextView basal;
private TextView target;
private static Button refreshButton;
private Button refreshButton;
Handler mHandler;
static HandlerThread mHandlerThread;

View file

@ -30,18 +30,18 @@ public class ProfileViewerDialog extends DialogFragment {
private static Logger log = LoggerFactory.getLogger(ProfileViewDialog.class);
private static TextView noProfile;
private static TextView units;
private static TextView dia;
private static TextView activeProfile;
private static TextView ic;
private static TextView isf;
private static TextView basal;
private static TextView target;
private static View dateDelimiter;
private static LinearLayout dateLayout;
private static TextView dateTextView;
private static Button refreshButton;
private TextView noProfile;
private TextView units;
private TextView dia;
private TextView activeProfile;
private TextView ic;
private TextView isf;
private TextView basal;
private TextView target;
private View dateDelimiter;
private LinearLayout dateLayout;
private TextView dateTextView;
private Button refreshButton;
static ProfileViewerDialog newInstance(long time) {
ProfileViewerDialog dialog = new ProfileViewerDialog();
@ -88,7 +88,7 @@ public class ProfileViewerDialog extends DialogFragment {
private void setContent() {
Profile profile = null;
ProfileSwitch profileSwitch = MainApp.getConfigBuilder().getProfileSwitchFromHistory(time);
if(profileSwitch!=null){
if(profileSwitch!=null && profileSwitch.profileJson != null){
profile = profileSwitch.getProfileObject();
}
if (profile != null) {
@ -105,9 +105,4 @@ public class ProfileViewerDialog extends DialogFragment {
noProfile.setVisibility(View.VISIBLE);
}
}
}