Java Code Examples for lecho.lib.hellocharts.model.Axis#DEFAULT_TEXT_SIZE_SP

The following examples show how to use lecho.lib.hellocharts.model.Axis#DEFAULT_TEXT_SIZE_SP . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
public BgGraphBuilder(Context context, long start, long end, int numValues){
    end_time = end;
    start_time = start;
    bgReadings = BgReading.latestForGraph( numValues, start, end);
    calibrations = Calibration.latestForGraph( numValues, start, end);
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl"));
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet(context) ? 5 : 3;
    axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet(context) ? 12 : 5;
    hoursPreviewStep = isXLargeTablet(context) ? 2 : 1;
}
 
Example 2
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
public BgGraphBuilder(Context context, long start, long end, int numValues){
    end_time = end;
    start_time = start;
    bgReadings = BgReading.latestForGraph( numValues, start, end);
    calibrations = Calibration.latestForGraph( numValues, start, end);
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl"));
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet(context) ? 5 : 3;
    axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet(context) ? 12 : 5;
    hoursPreviewStep = isXLargeTablet(context) ? 2 : 1;
}
 
Example 3
Source File: BgGraphBuilder.java    From xDrip-Experimental with GNU General Public License v3.0 6 votes vote down vote up
public BgGraphBuilder(Context context, long start, long end, int numValues){
    end_time = end;
    start_time = start;
    bgReadings = BgReading.latestForGraph( numValues, start, end);
    calibrations = Calibration.latestForGraph( numValues, start, end);
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl"));
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet(context) ? 5 : 3;
    axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet(context) ? 12 : 5;
    hoursPreviewStep = isXLargeTablet(context) ? 2 : 1;
}
 
Example 4
Source File: BgGraphBuilder.java    From NightWatch with GNU General Public License v3.0 5 votes vote down vote up
public BgGraphBuilder(Context context){
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet() ? 5 : 3;
    axisTextSize = isXLargeTablet() ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet() ? 12 : 5;
    hoursPreviewStep = isXLargeTablet() ? 2 : 1;
}
 
Example 5
Source File: BgGraphBuilder.java    From NightWatch with GNU General Public License v3.0 5 votes vote down vote up
public BgGraphBuilder(Context context){
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet() ? 5 : 3;
    axisTextSize = isXLargeTablet() ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet() ? 12 : 5;
    hoursPreviewStep = isXLargeTablet() ? 2 : 1;
}
 
Example 6
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
public BgGraphBuilder(Context context){
    this.context = context;
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    this.highMark = Double.parseDouble(prefs.getString("highValue", "170"));
    this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet() ? 5 : 3;
    axisTextSize = isXLargeTablet() ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet() ? 12 : 5;
    hoursPreviewStep = isXLargeTablet() ? 2 : 1;
}
 
Example 7
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
public BgGraphBuilder(Context context, long start, long end, int numValues, boolean show_prediction, final boolean useArchive) {
    // swap argument order if needed
    if (start > end) {
        long temp = end;
        end = start;
        start = temp;
        if (d) Log.d(TAG, "Swapping timestamps");
    }
    if (d)
        Log.d(TAG, "Called timestamps: " + JoH.dateTimeText(start) + " -> " + JoH.dateTimeText(end));
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prediction_enabled = show_prediction;
    if (prediction_enabled)
        simulation_enabled = prefs.getBoolean("simulations_enabled", true);
    end_time = end / FUZZER;
    start_time = start / FUZZER;

    readings_lock.lock();
    try {
        // store the initialization values used for this instance
        loaded_numValues=numValues;
        loaded_start=start;
        loaded_end=end;
        bgReadings = BgReading.latestForGraph(numValues, start, end);
        if (DexCollectionType.getDexCollectionType() == DexCollectionType.LibreReceiver)
            Libre2RawValues = Libre2RawValue.latestForGraph(numValues * 5, start, end);
        plugin_adjusted = false;
    } finally {
        readings_lock.unlock();
    }

    if ((end - start) > 80000000) {
        try {
            capturePercentage = ((bgReadings.size() * 100) / ((end - start) / 300000));
            //Log.d(TAG, "CPTIMEPERIOD: " + Long.toString(end - start) + " percentage: " + JoH.qs(capturePercentage));
        } catch (Exception e) {
            capturePercentage = -1; // invalid reading
        }
    }
    bloodtests = BloodTest.latestForGraph(numValues, start, end);
    // get extra calibrations so we can use them for historical readings
    calibrations = Calibration.latestForGraph(numValues, start - (3 * Constants.DAY_IN_MS), end);
    treatments = Treatments.latestForGraph(numValues, start, end + (120 * 60 * 1000));
    this.context = context;
    this.highMark = tolerantParseDouble(prefs.getString("highValue", "170"));
    this.lowMark = tolerantParseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl"));
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet(context) ? 5 : 3;
    axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet(context) ? 12 : 5;
    hoursPreviewStep = isXLargeTablet(context) ? 2 : 1;
}
 
Example 8
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
public BgGraphBuilder(Context context, long start, long end, int numValues, boolean show_prediction, final boolean useArchive) {
    // swap argument order if needed
    if (start > end) {
        long temp = end;
        end = start;
        start = temp;
        if (d) Log.d(TAG, "Swapping timestamps");
    }
    if (d)
        Log.d(TAG, "Called timestamps: " + JoH.dateTimeText(start) + " -> " + JoH.dateTimeText(end));
    this.prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prediction_enabled = show_prediction;
    if (prediction_enabled)
        simulation_enabled = prefs.getBoolean("simulations_enabled", true);
    end_time = end / FUZZER;
    start_time = start / FUZZER;

    readings_lock.lock();
    try {
        // store the initialization values used for this instance
        loaded_numValues=numValues;
        loaded_start=start;
        loaded_end=end;
        bgReadings = BgReading.latestForGraph(numValues, start, end);
        if (DexCollectionType.getDexCollectionType() == DexCollectionType.LibreReceiver)
            Libre2RawValues = Libre2RawValue.latestForGraph(numValues * 5, start, end);
        plugin_adjusted = false;
    } finally {
        readings_lock.unlock();
    }

    if ((end - start) > 80000000) {
        try {
            capturePercentage = ((bgReadings.size() * 100) / ((end - start) / 300000));
            //Log.d(TAG, "CPTIMEPERIOD: " + Long.toString(end - start) + " percentage: " + JoH.qs(capturePercentage));
        } catch (Exception e) {
            capturePercentage = -1; // invalid reading
        }
    }
    bloodtests = BloodTest.latestForGraph(numValues, start, end);
    // get extra calibrations so we can use them for historical readings
    calibrations = Calibration.latestForGraph(numValues, start - (3 * Constants.DAY_IN_MS), end);
    treatments = Treatments.latestForGraph(numValues, start, end + (120 * 60 * 1000));
    this.context = context;
    this.highMark = tolerantParseDouble(prefs.getString("highValue", "170"));
    this.lowMark = tolerantParseDouble(prefs.getString("lowValue", "70"));
    this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl"));
    defaultMinY = unitized(40);
    defaultMaxY = unitized(250);
    pointSize = isXLargeTablet(context) ? 5 : 3;
    axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP;
    previewAxisTextSize = isXLargeTablet(context) ? 12 : 5;
    hoursPreviewStep = isXLargeTablet(context) ? 2 : 1;
}