Search in sources :

Example 11 with OpenScale

use of com.health.openscale.core.OpenScale in project openScale by oliexdev.

the class DataEntryActivity method saveScaleData.

private void saveScaleData() {
    if (!isDirty) {
        return;
    }
    OpenScale openScale = OpenScale.getInstance(getApplicationContext());
    if (openScale.getSelectedScaleUserId() == -1) {
        return;
    }
    if (scaleMeasurement.getId() > 0) {
        openScale.updateScaleData(scaleMeasurement);
    } else {
        openScale.addScaleData(scaleMeasurement);
    }
    isDirty = false;
}
Also used : OpenScale(com.health.openscale.core.OpenScale)

Aggregations

OpenScale (com.health.openscale.core.OpenScale)11 ScaleUser (com.health.openscale.core.datatypes.ScaleUser)6 AlertDialog (android.app.AlertDialog)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2 DialogInterface (android.content.DialogInterface)2 Intent (android.content.Intent)2 SuppressLint (android.annotation.SuppressLint)1 SharedPreferences (android.content.SharedPreferences)1 Uri (android.net.Uri)1 Preference (android.preference.Preference)1 ScaleMeasurement (com.health.openscale.core.datatypes.ScaleMeasurement)1 Converters (com.health.openscale.core.utils.Converters)1 DateMeasurementView (com.health.openscale.gui.views.DateMeasurementView)1 MeasurementView (com.health.openscale.gui.views.MeasurementView)1 TimeMeasurementView (com.health.openscale.gui.views.TimeMeasurementView)1 WeightMeasurementView (com.health.openscale.gui.views.WeightMeasurementView)1 File (java.io.File)1 IOException (java.io.IOException)1 Date (java.util.Date)1 List (java.util.List)1