com.google.gson.internal.bind.DateTypeAdapter#com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder源码实例Demo

下面列出了com.google.gson.internal.bind.DateTypeAdapter#com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: xDrip-Experimental   文件: WatchUpdaterService.java
private void resendData() {
    if(googleApiClient != null && !googleApiClient.isConnected() && !googleApiClient.isConnecting()) { googleApiConnect(); }
    long startTime = new Date().getTime() - (60000 * 60 * 24);
    BgReading last_bg = BgReading.last();
    List<BgReading> graph_bgs = BgReading.latestForGraph(60, startTime);
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getApplicationContext());
    if (!graph_bgs.isEmpty()) {
        DataMap entries = dataMap(last_bg, mPrefs, bgGraphBuilder);
        final ArrayList<DataMap> dataMaps = new ArrayList<>(graph_bgs.size());
        for (BgReading bg : graph_bgs) {
            dataMaps.add(dataMap(bg, mPrefs, bgGraphBuilder));
        }
        entries.putDataMapArrayList("entries", dataMaps);

        new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).execute(entries);
    }
}
 
源代码2 项目: xDrip   文件: BgReading.java
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
源代码3 项目: xDrip   文件: Ob1G5StateMachine.java
private static void processBacksies(List<BackFillStream.Backsie> backsies) {
    boolean changed = false;
    for (BackFillStream.Backsie backsie : backsies) {
        final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime());

        final long since = JoH.msSince(time);
        if ((since > HOUR_IN_MS * 6) || (since < 0)) {
            UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)");
        } else {
            if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) {
                final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill");
                lastGlucoseBgReading = bgr;
                UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
                changed = true;
            }
            UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
        }
    }
    if (changed) {
        updateStreamedTillTimeForBackfill();
    }
}
 
源代码4 项目: xDrip   文件: SnoozeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //KS if (Home.get_holo()) { setTheme(R.style.OldAppTheme); }
    setContentView(R.layout.activity_snooze);
    alertStatus = (TextView) findViewById(R.id.alert_status);
    snoozeValue = (NumberPicker) findViewById(R.id.snooze);

    prefs =  PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);

    addListenerOnButton();
    if(BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        alertStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
        buttonSnooze.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
    }
    displayStatus();
}
 
源代码5 项目: xDrip   文件: Home.java
public void setupCharts() {
    bgGraphBuilder = new BgGraphBuilder(this);
    updateStuff = false;
    chart = (LineChartView) findViewById(R.id.chart);
    chart.setZoomType(ZoomType.HORIZONTAL);

    previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
    previewChart.setZoomType(ZoomType.HORIZONTAL);

    chart.setLineChartData(bgGraphBuilder.lineData());
    previewChart.setLineChartData(bgGraphBuilder.previewLineData());
    updateStuff = true;

    previewChart.setViewportCalculationEnabled(true);
    chart.setViewportCalculationEnabled(true);
    previewChart.setViewportChangeListener(new ViewportListener());
    chart.setViewportChangeListener(new ChartViewPortListener());
    setViewport();
}
 
源代码6 项目: xDrip   文件: BgReading.java
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
源代码7 项目: xDrip   文件: Ob1G5StateMachine.java
private static void processBacksies(List<BackFillStream.Backsie> backsies) {
    boolean changed = false;
    for (BackFillStream.Backsie backsie : backsies) {
        final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime());

        final long since = JoH.msSince(time);
        if ((since > HOUR_IN_MS * 6) || (since < 0)) {
            UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)");
        } else {
            if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) {
                final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill");
                lastGlucoseBgReading = bgr;
                UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
                changed = true;
            }
            UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
        }
    }
    if (changed) {
        updateStreamedTillTimeForBackfill();
    }
}
 
源代码8 项目: xDrip   文件: BGHistory.java
private void setupCharts() {
    dateButton1.setText(dateFormatter.format(date1.getTime()));

    Calendar endDate = (GregorianCalendar) date1.clone();
    endDate.add(Calendar.DATE, noDays);
    int numValues = noDays * (60 / 2) * 24; // LimiTTer sample rate 1 per 2 minutes
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues, false);

    chart = (LineChartView) findViewById(R.id.chart);
    chart.setZoomType(ZoomType.HORIZONTAL);
    previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
    previewChart.setZoomType(ZoomType.HORIZONTAL);

    chart.setLineChartData(bgGraphBuilder.lineData());
    chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener(this));
    previewChart.setLineChartData(bgGraphBuilder.previewLineData(chart.getLineChartData()));

    previewChart.setViewportCalculationEnabled(true);
    chart.setViewportCalculationEnabled(true);
    previewChart.setViewportChangeListener(new ViewportListener());
    chart.setViewportChangeListener(new ChartViewPortListener());

    setupStatistics(date1.getTimeInMillis(), endDate.getTimeInMillis());
}
 
源代码9 项目: xDrip-Experimental   文件: SnoozeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_snooze);
    alertStatus = (TextView) findViewById(R.id.alert_status);
    snoozeValue = (NumberPicker) findViewById(R.id.snooze);

    prefs =  PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);

    addListenerOnButton();
    if(BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        alertStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
        buttonSnooze.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
    }
    displayStatus();
}
 
源代码10 项目: xDrip   文件: WatchUpdaterService.java
private void resendData(long since) {
    Log.d(TAG, "resendData ENTER");
    forceGoogleApiConnect();
    final long startTime = since == 0 ? new Date().getTime() - (60000 * 60 * 24) : since;
    Log.d(TAG, "resendData googleApiClient connected ENTER, sending since: " + JoH.dateTimeText(startTime));
    final BgReading last_bg = BgReading.last();
    if (last_bg != null) {
        List<BgReading> graph_bgs = BgReading.latestForGraph(60, startTime);
        BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getApplicationContext());
        if (!graph_bgs.isEmpty()) {
            final int battery = PowerStateReceiver.getBatteryLevel(getApplicationContext());
            DataMap entries = dataMap(last_bg, mPrefs, bgGraphBuilder, battery);
            final ArrayList<DataMap> dataMaps = new ArrayList<>(graph_bgs.size());
            for (BgReading bg : graph_bgs) {
                dataMaps.add(dataMap(bg, mPrefs, bgGraphBuilder, battery));
            }
            entries.putLong("time", new Date().getTime()); // MOST IMPORTANT LINE FOR TIMESTAMP
            entries.putDataMapArrayList("entries", dataMaps);
            if (mPrefs.getBoolean("extra_status_line", false)) {
                entries.putString("extra_status_line", StatusLine.extraStatusLine());
            }

            new SendToDataLayerThread(WEARABLE_DATA_PATH, googleApiClient).executeOnExecutor(xdrip.executor, entries);
        }
    }
}
 
源代码11 项目: xDrip   文件: SnoozeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Home.get_holo()) { setTheme(R.style.OldAppThemeNoTitleBar); }
    JoH.fixActionBar(this);
    setContentView(R.layout.activity_snooze);
    alertStatus = (TextView) findViewById(R.id.alert_status);
    snoozeValue = (NumberPicker) findViewById(R.id.snooze);

    prefs =  PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);

    addListenerOnButton();
    if(BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        alertStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
        buttonSnooze.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
    }
    displayStatus();
}
 
源代码12 项目: xDrip-plus   文件: BgReading.java
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
源代码13 项目: xDrip-plus   文件: Ob1G5StateMachine.java
private static void processBacksies(List<BackFillStream.Backsie> backsies) {
    boolean changed = false;
    for (BackFillStream.Backsie backsie : backsies) {
        final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime());

        final long since = JoH.msSince(time);
        if ((since > HOUR_IN_MS * 6) || (since < 0)) {
            UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)");
        } else {
            if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) {
                final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill");
                lastGlucoseBgReading = bgr;
                UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
                changed = true;
            }
            UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
        }
    }
    if (changed) {
        updateStreamedTillTimeForBackfill();
    }
}
 
源代码14 项目: xDrip-plus   文件: SnoozeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //KS if (Home.get_holo()) { setTheme(R.style.OldAppTheme); }
    setContentView(R.layout.activity_snooze);
    alertStatus = (TextView) findViewById(R.id.alert_status);
    snoozeValue = (NumberPicker) findViewById(R.id.snooze);

    prefs =  PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);

    addListenerOnButton();
    if(BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        alertStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
        buttonSnooze.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
    }
    displayStatus();
}
 
源代码15 项目: xDrip-plus   文件: BgReading.java
public BgReading injectNoise(boolean save) {
    final BgReading bgReading = this;
    if (JoH.msSince(bgReading.timestamp) > Constants.MINUTE_IN_MS * 20) {
        bgReading.noise = "0";
    } else {
        BgGraphBuilder.refreshNoiseIfOlderThan(bgReading.timestamp);
        if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_HIGH) {
            bgReading.noise = "4";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TOO_HIGH_FOR_PREDICT) {
            bgReading.noise = "3";
        } else if (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER) {
            bgReading.noise = "2";
        }
    }
    if (save) bgReading.save();
    return bgReading;
}
 
源代码16 项目: xDrip-plus   文件: Ob1G5StateMachine.java
private static void processBacksies(List<BackFillStream.Backsie> backsies) {
    boolean changed = false;
    for (BackFillStream.Backsie backsie : backsies) {
        final long time = DexTimeKeeper.fromDexTime(getTransmitterID(), backsie.getDextime());

        final long since = JoH.msSince(time);
        if ((since > HOUR_IN_MS * 6) || (since < 0)) {
            UserError.Log.wtf(TAG, "Backfill timestamp unrealistic: " + JoH.dateTimeText(time) + " (ignored)");
        } else {
            if (BgReading.getForPreciseTimestamp(time, Constants.MINUTE_IN_MS * 4) == null) {
                final BgReading bgr = BgReading.bgReadingInsertFromG5(backsie.getGlucose(), time, "Backfill");
                lastGlucoseBgReading = bgr;
                UserError.Log.d(TAG, "Adding backfilled reading: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
                changed = true;
            }
            UserError.Log.d(TAG, "Backsie: " + JoH.dateTimeText(time) + " " + BgGraphBuilder.unitized_string_static(backsie.getGlucose()));
        }
    }
    if (changed) {
        updateStreamedTillTimeForBackfill();
    }
}
 
源代码17 项目: xDrip-plus   文件: BGHistory.java
private void setupCharts() {
    dateButton1.setText(dateFormatter.format(date1.getTime()));

    Calendar endDate = (GregorianCalendar) date1.clone();
    endDate.add(Calendar.DATE, noDays);
    int numValues = noDays * (60 / 2) * 24; // LimiTTer sample rate 1 per 2 minutes
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues, false);

    chart = (LineChartView) findViewById(R.id.chart);
    chart.setZoomType(ZoomType.HORIZONTAL);
    previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
    previewChart.setZoomType(ZoomType.HORIZONTAL);

    chart.setLineChartData(bgGraphBuilder.lineData());
    chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener(this));
    previewChart.setLineChartData(bgGraphBuilder.previewLineData(chart.getLineChartData()));

    previewChart.setViewportCalculationEnabled(true);
    chart.setViewportCalculationEnabled(true);
    previewChart.setViewportChangeListener(new ViewportListener());
    chart.setViewportChangeListener(new ChartViewPortListener());

    setupStatistics(date1.getTimeInMillis(), endDate.getTimeInMillis());
}
 
源代码18 项目: xDrip-plus   文件: SnoozeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Home.get_holo()) { setTheme(R.style.OldAppThemeNoTitleBar); }
    JoH.fixActionBar(this);
    setContentView(R.layout.activity_snooze);
    alertStatus = (TextView) findViewById(R.id.alert_status);
    snoozeValue = (NumberPicker) findViewById(R.id.snooze);

    prefs =  PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    doMgdl = (prefs.getString("units", "mgdl").compareTo("mgdl") == 0);

    addListenerOnButton();
    if(BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        alertStatus.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
        buttonSnooze.setTextSize(TypedValue.COMPLEX_UNIT_SP, 30);
    }
    displayStatus();
}
 
源代码19 项目: xDrip-Experimental   文件: BGHistory.java
private void setupCharts() {
    dateButton1.setText(dateFormatter.format(date1.getTime()));

    Calendar endDate = (GregorianCalendar) date1.clone();
    endDate.add(Calendar.DATE, noDays);
    int numValues = noDays * (60 / 5) * 24;
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(this, date1.getTimeInMillis(), endDate.getTimeInMillis(), numValues);

    chart = (LineChartView) findViewById(R.id.chart);
    chart.setZoomType(ZoomType.HORIZONTAL);
    previewChart = (PreviewLineChartView) findViewById(R.id.chart_preview);
    previewChart.setZoomType(ZoomType.HORIZONTAL);

    chart.setLineChartData(bgGraphBuilder.lineData());
    chart.setOnValueTouchListener(bgGraphBuilder.getOnValueSelectTooltipListener());
    previewChart.setLineChartData(bgGraphBuilder.previewLineData());

    previewChart.setViewportCalculationEnabled(true);
    chart.setViewportCalculationEnabled(true);
    previewChart.setViewportChangeListener(new ViewportListener());
    chart.setViewportChangeListener(new ChartViewPortListener());
}
 
源代码20 项目: xDrip   文件: BestGlucose.java
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}
 
源代码21 项目: xDrip   文件: BestGlucose.java
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean doMgdl, double value1, long timestamp1, double value2, long timestamp2) {

        // timestamps invalid or too far apart return ???
        if ((timestamp1 < 0)
                || (timestamp2 < 0)
                || (value1 < 0)
                || (value2 < 0)
                || (timestamp2 > timestamp1)
                || (timestamp1 - timestamp2 > (20 * 60 * 1000)))
            return "???";

        double value = calculateSlope(value1, timestamp1, value2, timestamp2) * 5 * 60 * 1000;

        return BgGraphBuilder.unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl);
    }
 
源代码22 项目: xDrip   文件: BestGlucose.java
protected static boolean compensateNoise() {
    return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER
            || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE
                    && Pref.getBooleanDefaultFalse("engineering_mode")
                    && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")
            ))
            && (BgGraphBuilder.best_bg_estimate > 0)
            && (BgGraphBuilder.last_bg_estimate > 0)
            && (prefs.getBoolean("bg_compensate_noise", false));
}
 
源代码23 项目: xDrip   文件: BestGlucose.java
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean doMgdl, double value1, long timestamp1, double value2, long timestamp2) {

        // timestamps invalid or too far apart return ???
        if ((timestamp1 < 0)
                || (timestamp2 < 0)
                || (value1 < 0)
                || (value2 < 0)
                || (timestamp2 > timestamp1)
                || (timestamp1 - timestamp2 > (20 * 60 * 1000)))
            return "???";

        double value = calculateSlope(value1, timestamp1, value2, timestamp2) * 5 * 60 * 1000;

        return BgGraphBuilder.unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl);
    }
 
源代码24 项目: xDrip   文件: LibreWifiReader.java
static List<StatusItem> megaStatus() {
    final List<StatusItem> l = new ArrayList<>();
    for (Map.Entry<String, String> entry : hostStatus.entrySet()) {
        final long status_time = hostStatusTime.get(entry.getKey());
        if (entry.getValue().length() > 0)
            l.add(new StatusItem(entry.getKey(), entry.getValue() + ((status_time != 0) ? (" " + JoH.niceTimeSince(status_time) + " " + "ago") : ""), JoH.msSince(status_time) <= BgGraphBuilder.DEXCOM_PERIOD ? StatusItem.Highlight.GOOD : JoH.msSince(status_time) <= BgGraphBuilder.DEXCOM_PERIOD * 2 ? StatusItem.Highlight.NOTICE : StatusItem.Highlight.NORMAL));
    }
    return l;
}
 
源代码25 项目: xDrip   文件: WixelReader.java
static List<StatusItem> megaStatus() {
    final List<StatusItem> l = new ArrayList<>();
    for (Map.Entry<String, String> entry : hostStatus.entrySet()) {
        final long status_time = hostStatusTime.get(entry.getKey());
        if (entry.getValue().length() > 0)
            l.add(new StatusItem(entry.getKey(), entry.getValue() + ((status_time != 0) ? (" " + JoH.niceTimeSince(status_time) + " " + "ago") : ""), JoH.msSince(status_time) <= BgGraphBuilder.DEXCOM_PERIOD ? StatusItem.Highlight.GOOD : JoH.msSince(status_time) <= BgGraphBuilder.DEXCOM_PERIOD * 2 ? StatusItem.Highlight.NOTICE : StatusItem.Highlight.NORMAL));
    }
    return l;
}
 
源代码26 项目: xDrip   文件: ExampleChartPreferenceView.java
protected void refreshView(View view) {
    LineChartView chart = (LineChartView) view.findViewById(R.id.example_linechart);
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getContext());
    chart.setLineChartData(bgGraphBuilder.lineData());
    Viewport viewport = chart.getMaximumViewport();
    chart.setViewportCalculationEnabled(false);
    chart.setInteractive(false);
    chart.setCurrentViewport(viewport);
    chart.setPadding(0, 0, 0, 0);
    chart.setLeft(0);
    chart.setTop(0);
    Log.d(TAG, "onBindExampleChart: refreshview " + chart.getHeight());
}
 
源代码27 项目: xDrip   文件: PebbleWatchSync.java
@Override
public void onCreate() {
    super.onCreate();
    context = getApplicationContext();
    bgGraphBuilder = new BgGraphBuilder(context);

    initPebbleDisplays();
    PebbleUtil.pebbleDisplayType = getCurrentBroadcastToPebbleSetting();
    Log.d(TAG,"onCreate for: "+PebbleUtil.pebbleDisplayType.toString());

    currentWatchFaceUUID = getActivePebbleDisplay().watchfaceUUID();

    init();
}
 
源代码28 项目: xDrip   文件: Home.java
private void addDisplayDelta() {
    if (BgGraphBuilder.isXLargeTablet(getApplicationContext())) {
        if (Locale.getDefault().getLanguage() == "iw") {
            HebrewAppendDisplayData();
        } else {
            notificationText.append("  ");
            notificationText.append(display_delta);
        }
    } else {
        notificationText.append("\n");
        notificationText.append(display_delta);
    }
}
 
源代码29 项目: xDrip   文件: Amazfitservice.java
private Bitmap createWearBitmapSmallDots(long start, long end) {
    return new BgSparklineBuilder(xdrip.getAppContext())
            .setBgGraphBuilder(new BgGraphBuilder(xdrip.getAppContext()))
            .setStart(start)
            .setEnd(end)
            .showAxes()
            .setWidthPx(290)
            .setHeightPx(160)
            .setSmallDots()
            .build();
}
 
源代码30 项目: xDrip   文件: Amazfitservice.java
private Bitmap createWFBitmapTinyDots(long start, long end) {
    return new BgSparklineBuilder(xdrip.getAppContext())
            .setBgGraphBuilder(new BgGraphBuilder(xdrip.getAppContext()))
            .setStart(start)
            .setEnd(end)
            //.showAxes()
            .setWidthPx(300)
            .setHeightPx(130)
            .setTinyDots()
            .build();
}