public static SpannableString nanoStatus() { if (android_wear) { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(lastSensorStatus != null ? lastSensorStatus + "\n" : ""); builder.append(state.getString()); return new SpannableString(builder); } else { if (lastSensorState != null && lastSensorState != CalibrationState.Ok) { return Span.colorSpan(lastSensorState.getExtendedText(), lastSensorState == CalibrationState.WarmingUp ? NOTICE.color() : lastSensorState.sensorFailed() ? CRITICAL.color() : BAD.color()); } else { return null; } } }
public static SpannableString nanoStatus() { if (android_wear) { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(lastSensorStatus != null ? lastSensorStatus + "\n" : ""); builder.append(state.getString()); return new SpannableString(builder); } else { if (lastSensorState != null && lastSensorState != CalibrationState.Ok) { return Span.colorSpan(lastSensorState.getExtendedText(), lastSensorState == CalibrationState.WarmingUp ? NOTICE.color() : lastSensorState.sensorFailed() ? CRITICAL.color() : BAD.color()); } else { return null; } } }
public static SpannableString nanoStatus() { if (android_wear) { final SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(lastSensorStatus != null ? lastSensorStatus + "\n" : ""); builder.append(state.getString()); return new SpannableString(builder); } else { if (lastSensorState != null && lastSensorState != CalibrationState.Ok) { return Span.colorSpan(lastSensorState.getExtendedText(), lastSensorState == CalibrationState.WarmingUp ? NOTICE.color() : lastSensorState.sensorFailed() ? CRITICAL.color() : BAD.color()); } else { return null; } } }
lastSensorStatus = state.getExtendedText(); lastSensorState = state; UserError.Log.ueh(TAG, "Native Sensor is now Stopped: " + state.getExtendedText()); } else if (is_started && !was_started) { JoH.cancelNotification(G5_SENSOR_STARTED); UserError.Log.ueh(TAG, "Native Sensor is now Started: " + state.getExtendedText()); final PendingIntent pi = PendingIntent.getActivity(xdrip.getAppContext(), G5_SENSOR_FAILED, JoH.getStartActivityIntent(Home.class), PendingIntent.FLAG_UPDATE_CURRENT); JoH.showNotification(state.getText(), "G5 Sensor FAILED", pi, G5_SENSOR_FAILED, true, true, false); UserError.Log.ueh(TAG, "Native Sensor is now marked FAILED: " + state.getExtendedText());
lastSensorStatus = state.getExtendedText(); lastSensorState = state; UserError.Log.ueh(TAG, "Native Sensor is now Stopped: " + state.getExtendedText()); } else if (is_started && !was_started) { JoH.cancelNotification(G5_SENSOR_STARTED); UserError.Log.ueh(TAG, "Native Sensor is now Started: " + state.getExtendedText()); final PendingIntent pi = PendingIntent.getActivity(xdrip.getAppContext(), G5_SENSOR_FAILED, JoH.getStartActivityIntent(Home.class), PendingIntent.FLAG_UPDATE_CURRENT); JoH.showNotification(state.getText(), "G5 Sensor FAILED", pi, G5_SENSOR_FAILED, true, true, false); UserError.Log.ueh(TAG, "Native Sensor is now marked FAILED: " + state.getExtendedText());
lastSensorStatus = state.getExtendedText(); lastSensorState = state; UserError.Log.ueh(TAG, "Native Sensor is now Stopped: " + state.getExtendedText()); } else if (is_started && !was_started) { JoH.cancelNotification(G5_SENSOR_STARTED); UserError.Log.ueh(TAG, "Native Sensor is now Started: " + state.getExtendedText()); final PendingIntent pi = PendingIntent.getActivity(xdrip.getAppContext(), G5_SENSOR_FAILED, JoH.getStartActivityIntent(Home.class), PendingIntent.FLAG_UPDATE_CURRENT); JoH.showNotification(state.getText(), "G5 Sensor FAILED", pi, G5_SENSOR_FAILED, true, true, false); UserError.Log.ueh(TAG, "Native Sensor is now marked FAILED: " + state.getExtendedText());