// Path: app/src/main/java/de/dorianscholz/openlibre/model/BloodGlucoseData.java
// public class BloodGlucoseData extends RealmObject implements Comparable<BloodGlucoseData> {
//     public static final String ID = "id";
//     static final String GLUCOSE_LEVEL = "glucoseLevel";
//     public static final String DATE = "date";
//     public static final String TIMEZONE_OFFSET_IN_MINUTES = "timezoneOffsetInMinutes";
// 
//     @PrimaryKey
//     private String id;
//     private float glucoseLevel = -1; // in mg/dl
//     private long date;
//     private int timezoneOffsetInMinutes;
// 
//     public BloodGlucoseData() {}
//     public BloodGlucoseData(long date, float glucoseLevel) {
//         this.date = date;
//         timezoneOffsetInMinutes = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000 / 60;
//         this.glucoseLevel = glucoseLevel;
//         id = String.format(Locale.US, "blood_%s", mFormatDateTime.format(new Date(date)));
//     }
// 
//     public float glucose() {
//         return glucoseLevel;
//     }
// 
//     public String glucoseString() {
//         return formatValue(glucose());
//     }
// 
//     @Override
//     public int compareTo(@NonNull BloodGlucoseData another) {
//         return (int) (date - another.date);
//     }
// 
//     public long getDate() {
//         return date;
//     }
// 
//     public int getTimezoneOffsetInMinutes() {
//         return timezoneOffsetInMinutes;
//     }
// }
// 
// Path: app/src/main/java/de/dorianscholz/openlibre/OpenLibre.java
// public static RealmConfiguration realmConfigUserData;


import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import java.util.Date;
import de.dorianscholz.openlibre.R;
import de.dorianscholz.openlibre.model.BloodGlucoseData;
import io.realm.Realm;
import static de.dorianscholz.openlibre.OpenLibre.realmConfigUserData;
package de.dorianscholz.openlibre.ui;






public class BloodGlucoseInputFragment extends DialogFragment {
    public BloodGlucoseInputFragment() {
        // Required empty public constructor
    }

    public static BloodGlucoseInputFragment newInstance() {
        BloodGlucoseInputFragment fragment = new BloodGlucoseInputFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    public void saveBloodGlucoseLevel(long date, float bloodGlucoseLevel) {
// Path: app/src/main/java/de/dorianscholz/openlibre/model/BloodGlucoseData.java
// public class BloodGlucoseData extends RealmObject implements Comparable<BloodGlucoseData> {
//     public static final String ID = "id";
//     static final String GLUCOSE_LEVEL = "glucoseLevel";
//     public static final String DATE = "date";
//     public static final String TIMEZONE_OFFSET_IN_MINUTES = "timezoneOffsetInMinutes";
// 
//     @PrimaryKey
//     private String id;
//     private float glucoseLevel = -1; // in mg/dl
//     private long date;
//     private int timezoneOffsetInMinutes;
// 
//     public BloodGlucoseData() {}
//     public BloodGlucoseData(long date, float glucoseLevel) {
//         this.date = date;
//         timezoneOffsetInMinutes = TimeZone.getDefault().getOffset(System.currentTimeMillis()) / 1000 / 60;
//         this.glucoseLevel = glucoseLevel;
//         id = String.format(Locale.US, "blood_%s", mFormatDateTime.format(new Date(date)));
//     }
// 
//     public float glucose() {
//         return glucoseLevel;
//     }
// 
//     public String glucoseString() {
//         return formatValue(glucose());
//     }
// 
//     @Override
//     public int compareTo(@NonNull BloodGlucoseData another) {
//         return (int) (date - another.date);
//     }
// 
//     public long getDate() {
//         return date;
//     }
// 
//     public int getTimezoneOffsetInMinutes() {
//         return timezoneOffsetInMinutes;
//     }
// }
// 
// Path: app/src/main/java/de/dorianscholz/openlibre/OpenLibre.java
// public static RealmConfiguration realmConfigUserData;


// Path: app/src/main/java/de/dorianscholz/openlibre/ui/BloodGlucoseInputFragment.java
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import java.util.Date;
import de.dorianscholz.openlibre.R;
import de.dorianscholz.openlibre.model.BloodGlucoseData;
import io.realm.Realm;
import static de.dorianscholz.openlibre.OpenLibre.realmConfigUserData;

package de.dorianscholz.openlibre.ui;






public class BloodGlucoseInputFragment extends DialogFragment {
    public BloodGlucoseInputFragment() {
        // Required empty public constructor
    }

    public static BloodGlucoseInputFragment newInstance() {
        BloodGlucoseInputFragment fragment = new BloodGlucoseInputFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    public void saveBloodGlucoseLevel(long date, float bloodGlucoseLevel) {
        Realm realmUserData = Realm.getInstance(realmConfigUserData);