mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-21 07:51:46 +02:00
Revert " Refactor preferences (#233)"
This reverts commit 34e6856ebf
.
Will merge again with history.
This commit is contained in:
@@ -47,10 +47,6 @@ import com.health.openscale.core.datatypes.ScaleUser;
|
|||||||
import com.health.openscale.core.utils.Converters;
|
import com.health.openscale.core.utils.Converters;
|
||||||
import com.health.openscale.core.utils.CsvHelper;
|
import com.health.openscale.core.utils.CsvHelper;
|
||||||
import com.health.openscale.gui.fragments.FragmentUpdateListener;
|
import com.health.openscale.gui.fragments.FragmentUpdateListener;
|
||||||
import com.health.openscale.gui.views.FatMeasurementView;
|
|
||||||
import com.health.openscale.gui.views.LBWMeasurementView;
|
|
||||||
import com.health.openscale.gui.views.MeasurementViewSettings;
|
|
||||||
import com.health.openscale.gui.views.WaterMeasurementView;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -258,24 +254,21 @@ public class OpenScale {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MeasurementViewSettings settings = new MeasurementViewSettings(prefs, WaterMeasurementView.KEY);
|
if (prefs.getBoolean("estimateWaterEnable", false)) {
|
||||||
if (settings.isEnabled() && settings.isEstimationEnabled()) {
|
EstimatedWaterMetric waterMetric = EstimatedWaterMetric.getEstimatedMetric(EstimatedWaterMetric.FORMULA.valueOf(prefs.getString("estimateWaterFormula", "TBW_LEESONGKIM")));
|
||||||
EstimatedWaterMetric waterMetric = EstimatedWaterMetric.getEstimatedMetric(
|
|
||||||
EstimatedWaterMetric.FORMULA.valueOf(settings.getEstimationFormula()));
|
|
||||||
scaleMeasurement.setWater(waterMetric.getWater(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
scaleMeasurement.setWater(waterMetric.getWater(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
||||||
}
|
}
|
||||||
|
|
||||||
settings = new MeasurementViewSettings(prefs, LBWMeasurementView.KEY);
|
if (prefs.getBoolean("estimateLBWEnable", false)) {
|
||||||
if (settings.isEnabled() && settings.isEstimationEnabled()) {
|
EstimatedLBWMetric lbwMetric = EstimatedLBWMetric.getEstimatedMetric(EstimatedLBWMetric.FORMULA.valueOf(prefs.getString("estimateLBWFormula", "LBW_HUME")));
|
||||||
EstimatedLBWMetric lbwMetric = EstimatedLBWMetric.getEstimatedMetric(
|
|
||||||
EstimatedLBWMetric.FORMULA.valueOf(settings.getEstimationFormula()));
|
|
||||||
scaleMeasurement.setLbw(lbwMetric.getLBW(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
scaleMeasurement.setLbw(lbwMetric.getLBW(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
||||||
}
|
}
|
||||||
|
|
||||||
settings = new MeasurementViewSettings(prefs, FatMeasurementView.KEY);
|
if (prefs.getBoolean("estimateFatEnable", false)) {
|
||||||
if (settings.isEnabled() && settings.isEstimationEnabled()) {
|
EstimatedFatMetric fatMetric = EstimatedFatMetric.getEstimatedMetric(EstimatedFatMetric.FORMULA.valueOf(prefs.getString("estimateFatFormula", "BF_GALLAGHER")));
|
||||||
EstimatedFatMetric fatMetric = EstimatedFatMetric.getEstimatedMetric(
|
|
||||||
EstimatedFatMetric.FORMULA.valueOf(settings.getEstimationFormula()));
|
|
||||||
scaleMeasurement.setFat(fatMetric.getFat(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
scaleMeasurement.setFat(fatMetric.getFat(getScaleUser(scaleMeasurement.getUserId()), scaleMeasurement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,9 +27,12 @@ import com.health.openscale.core.datatypes.ScaleMeasurement;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class BluetoothIhealthHS3 extends BluetoothCommunication {
|
public class BluetoothIhealthHS3 extends BluetoothCommunication {
|
||||||
|
@@ -302,15 +302,6 @@ public class DataEntryActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isDirty = true;
|
isDirty = true;
|
||||||
|
|
||||||
// Measurements that aren't visible should not store any value. Since we use values from
|
|
||||||
// the previous measurement there might be values for entries not shown. The loop below
|
|
||||||
// clears these values.
|
|
||||||
for (MeasurementView measurement : dataEntryMeasurements) {
|
|
||||||
if (!measurement.isVisible()) {
|
|
||||||
measurement.clearIn(scaleMeasurement);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MeasurementView measurement : dataEntryMeasurements) {
|
for (MeasurementView measurement : dataEntryMeasurements) {
|
||||||
|
@@ -43,10 +43,8 @@ import com.health.openscale.core.OpenScale;
|
|||||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||||
import com.health.openscale.core.utils.PolynomialFitter;
|
import com.health.openscale.core.utils.PolynomialFitter;
|
||||||
import com.health.openscale.gui.activities.DataEntryActivity;
|
import com.health.openscale.gui.activities.DataEntryActivity;
|
||||||
import com.health.openscale.gui.views.BMRMeasurementView;
|
|
||||||
import com.health.openscale.gui.views.FloatMeasurementView;
|
import com.health.openscale.gui.views.FloatMeasurementView;
|
||||||
import com.health.openscale.gui.views.MeasurementView;
|
import com.health.openscale.gui.views.MeasurementView;
|
||||||
import com.health.openscale.gui.views.MeasurementViewSettings;
|
|
||||||
import com.health.openscale.gui.views.WeightMeasurementView;
|
import com.health.openscale.gui.views.WeightMeasurementView;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -251,7 +249,7 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
private void addFloatingActionButton(FloatMeasurementView measurementView) {
|
private void addFloatingActionButton(FloatMeasurementView measurementView) {
|
||||||
FloatingActionButton actionButton = new FloatingActionButton(getContext());
|
FloatingActionButton actionButton = new FloatingActionButton(getContext());
|
||||||
|
|
||||||
actionButton.setTag(measurementView.getKey());
|
actionButton.setTag("actionButton" + measurementView.getName());
|
||||||
actionButton.setColorFilter(Color.parseColor("#000000"));
|
actionButton.setColorFilter(Color.parseColor("#000000"));
|
||||||
actionButton.setImageDrawable(measurementView.getIcon());
|
actionButton.setImageDrawable(measurementView.getIcon());
|
||||||
actionButton.setClickable(true);
|
actionButton.setClickable(true);
|
||||||
@@ -261,9 +259,11 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
actionButton.setLayoutParams(lay);
|
actionButton.setLayoutParams(lay);
|
||||||
actionButton.setOnClickListener(new onClickListenerDiagramLines());
|
actionButton.setOnClickListener(new onClickListenerDiagramLines());
|
||||||
|
|
||||||
int color = measurementView.getSettings().isInGraph()
|
if (prefs.getBoolean(String.valueOf("actionButton" + measurementView.getName()), true)) {
|
||||||
? measurementView.getColor() : Color.parseColor("#d3d3d3");
|
actionButton.setBackgroundTintList(ColorStateList.valueOf(measurementView.getColor()));
|
||||||
actionButton.setBackgroundTintList(ColorStateList.valueOf(color));
|
} else {
|
||||||
|
actionButton.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor("#d3d3d3")));
|
||||||
|
}
|
||||||
|
|
||||||
floatingActionBar.addView(actionButton);
|
floatingActionBar.addView(actionButton);
|
||||||
}
|
}
|
||||||
@@ -326,7 +326,7 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
if (view instanceof FloatMeasurementView) {
|
if (view instanceof FloatMeasurementView) {
|
||||||
FloatMeasurementView measurementView = (FloatMeasurementView) view;
|
FloatMeasurementView measurementView = (FloatMeasurementView) view;
|
||||||
|
|
||||||
if (measurementView instanceof BMRMeasurementView) {
|
if (measurementView.getName().equals(getString(R.string.label_bmr))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,7 +385,7 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
if (measurementView.isVisible()) {
|
if (measurementView.isVisible()) {
|
||||||
addFloatingActionButton(measurementView);
|
addFloatingActionButton(measurementView);
|
||||||
|
|
||||||
if (measurementView.getSettings().isInGraph()) {
|
if (prefs.getBoolean(String.valueOf("actionButton" + measurementView.getName()), true)) {
|
||||||
diagramLineList.add(diagramLine);
|
diagramLineList.add(diagramLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -587,9 +587,11 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
|
|
||||||
String key = String.valueOf(actionButton.getTag());
|
if (prefs.getBoolean(String.valueOf(actionButton.getTag()), true)) {
|
||||||
MeasurementViewSettings settings = new MeasurementViewSettings(prefs, key);
|
prefs.edit().putBoolean(String.valueOf(actionButton.getTag()), false).commit();
|
||||||
prefs.edit().putBoolean(settings.getInGraphKey(), !settings.isInGraph()).apply();
|
} else {
|
||||||
|
prefs.edit().putBoolean(String.valueOf(actionButton.getTag()), true).commit();
|
||||||
|
}
|
||||||
|
|
||||||
generateGraphs();
|
generateGraphs();
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,6 @@ import com.health.openscale.core.datatypes.ScaleMeasurement;
|
|||||||
import com.health.openscale.core.datatypes.ScaleUser;
|
import com.health.openscale.core.datatypes.ScaleUser;
|
||||||
import com.health.openscale.core.utils.Converters;
|
import com.health.openscale.core.utils.Converters;
|
||||||
import com.health.openscale.core.utils.DateTimeHelpers;
|
import com.health.openscale.core.utils.DateTimeHelpers;
|
||||||
import com.health.openscale.gui.views.BMRMeasurementView;
|
|
||||||
import com.health.openscale.gui.views.FloatMeasurementView;
|
import com.health.openscale.gui.views.FloatMeasurementView;
|
||||||
import com.health.openscale.gui.views.MeasurementView;
|
import com.health.openscale.gui.views.MeasurementView;
|
||||||
|
|
||||||
@@ -228,7 +227,8 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener
|
|||||||
|
|
||||||
for (MeasurementView view : measurementViews) {
|
for (MeasurementView view : measurementViews) {
|
||||||
if (!view.isVisible()
|
if (!view.isVisible()
|
||||||
|| !view.getSettings().isInOverviewGraph()
|
|| !prefs.getBoolean(String.valueOf("actionButton" + view.getName()), true)
|
||||||
|
|| view.getName().equals(getString(R.string.label_bmr))
|
||||||
|| !(view instanceof FloatMeasurementView)) {
|
|| !(view instanceof FloatMeasurementView)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ public class OverviewFragment extends Fragment implements FragmentUpdateListener
|
|||||||
if (view instanceof FloatMeasurementView) {
|
if (view instanceof FloatMeasurementView) {
|
||||||
FloatMeasurementView measurementView = (FloatMeasurementView) view;
|
FloatMeasurementView measurementView = (FloatMeasurementView) view;
|
||||||
|
|
||||||
if (measurementView instanceof BMRMeasurementView) {
|
if (measurementView.getName().equals(getString(R.string.label_bmr))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
package com.health.openscale.gui.fragments;
|
package com.health.openscale.gui.fragments;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -65,6 +67,7 @@ public class StatisticsFragment extends Fragment implements FragmentUpdateListen
|
|||||||
private TableLayout tableMonthAveragesLayoutColumnA;
|
private TableLayout tableMonthAveragesLayoutColumnA;
|
||||||
private TableLayout tableMonthAveragesLayoutColumnB;
|
private TableLayout tableMonthAveragesLayoutColumnB;
|
||||||
|
|
||||||
|
private SharedPreferences prefs;
|
||||||
private ScaleUser currentScaleUser;
|
private ScaleUser currentScaleUser;
|
||||||
private ScaleMeasurement lastScaleMeasurement;
|
private ScaleMeasurement lastScaleMeasurement;
|
||||||
|
|
||||||
@@ -75,6 +78,8 @@ public class StatisticsFragment extends Fragment implements FragmentUpdateListen
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
statisticsView = inflater.inflate(R.layout.fragment_statistics, container, false);
|
statisticsView = inflater.inflate(R.layout.fragment_statistics, container, false);
|
||||||
|
|
||||||
|
prefs = PreferenceManager.getDefaultSharedPreferences(statisticsView.getContext());
|
||||||
|
|
||||||
txtGoalWeight = (TextView) statisticsView.findViewById(R.id.txtGoalWeight);
|
txtGoalWeight = (TextView) statisticsView.findViewById(R.id.txtGoalWeight);
|
||||||
txtGoalDiff = (TextView) statisticsView.findViewById(R.id.txtGoalDiff);
|
txtGoalDiff = (TextView) statisticsView.findViewById(R.id.txtGoalDiff);
|
||||||
txtGoalDayLeft = (TextView) statisticsView.findViewById(R.id.txtGoalDayLeft);
|
txtGoalDayLeft = (TextView) statisticsView.findViewById(R.id.txtGoalDayLeft);
|
||||||
@@ -105,9 +110,9 @@ public class StatisticsFragment extends Fragment implements FragmentUpdateListen
|
|||||||
|
|
||||||
for (MeasurementView measurement : viewMeasurementsListWeek) {
|
for (MeasurementView measurement : viewMeasurementsListWeek) {
|
||||||
measurement.setEditMode(STATISTIC);
|
measurement.setEditMode(STATISTIC);
|
||||||
|
measurement.updatePreferences(prefs);
|
||||||
|
|
||||||
if (measurement.getSettings().isEnabled()) {
|
if (measurement.isVisible()) {
|
||||||
measurement.setVisible(true);
|
|
||||||
measurement.setPadding(-1, -1, -1, paddingBottom);
|
measurement.setPadding(-1, -1, -1, paddingBottom);
|
||||||
if ((i % 2) == 0) {
|
if ((i % 2) == 0) {
|
||||||
tableWeekAveragesLayoutColumnA.addView(measurement);
|
tableWeekAveragesLayoutColumnA.addView(measurement);
|
||||||
@@ -133,9 +138,9 @@ public class StatisticsFragment extends Fragment implements FragmentUpdateListen
|
|||||||
|
|
||||||
for (MeasurementView measurement : viewMeasurementsListMonth) {
|
for (MeasurementView measurement : viewMeasurementsListMonth) {
|
||||||
measurement.setEditMode(STATISTIC);
|
measurement.setEditMode(STATISTIC);
|
||||||
|
measurement.updatePreferences(prefs);
|
||||||
|
|
||||||
if (measurement.getSettings().isEnabled()) {
|
if (measurement.isVisible()) {
|
||||||
measurement.setVisible(true);
|
|
||||||
measurement.setPadding(-1, -1, -1, paddingBottom);
|
measurement.setPadding(-1, -1, -1, paddingBottom);
|
||||||
if ((i % 2) == 0) {
|
if ((i % 2) == 0) {
|
||||||
tableMonthAveragesLayoutColumnA.addView(measurement);
|
tableMonthAveragesLayoutColumnA.addView(measurement);
|
||||||
|
@@ -23,6 +23,7 @@ import android.preference.MultiSelectListPreference;
|
|||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
/* Copyright (C) 2014 olie.xdev <olie.xdev@googlemail.com>
|
/* Copyright (C) 2014 olie.xdev <olie.xdev@googlemail.com>
|
||||||
* Copyright (C) 2018 Erik Johansson <erik@ejohansson.se>
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,46 +16,77 @@
|
|||||||
package com.health.openscale.gui.preferences;
|
package com.health.openscale.gui.preferences;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.database.DataSetObserver;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.CheckBoxPreference;
|
||||||
|
import android.preference.EditTextPreference;
|
||||||
|
import android.preference.ListPreference;
|
||||||
|
import android.preference.MultiSelectListPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceCategory;
|
import android.preference.PreferenceCategory;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.util.TypedValue;
|
import android.preference.SwitchPreference;
|
||||||
import android.view.DragEvent;
|
import android.view.DragEvent;
|
||||||
import android.view.GestureDetector;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.ListAdapter;
|
|
||||||
import android.widget.Switch;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.OpenScale;
|
import com.health.openscale.core.OpenScale;
|
||||||
|
import com.health.openscale.core.bodymetric.EstimatedFatMetric;
|
||||||
|
import com.health.openscale.core.bodymetric.EstimatedLBWMetric;
|
||||||
|
import com.health.openscale.core.bodymetric.EstimatedWaterMetric;
|
||||||
import com.health.openscale.gui.views.MeasurementView;
|
import com.health.openscale.gui.views.MeasurementView;
|
||||||
import com.health.openscale.gui.views.WeightMeasurementView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class MeasurementPreferences extends PreferenceFragment {
|
public class MeasurementPreferences extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
public static final String PREFERENCE_KEY_DELETE_ALL = "deleteAll";
|
public static final String PREFERENCE_KEY_DELETE_ALL = "deleteAll";
|
||||||
|
public static final String PREFERENCE_KEY_FAT = "fatEnable";
|
||||||
|
public static final String PREFERENCE_KEY_FAT_PERCENTAGE = "fatPercentageEnable";
|
||||||
|
public static final String PREFERENCE_KEY_WATER = "waterEnable";
|
||||||
|
public static final String PREFERENCE_KEY_WATER_PERCENTAGE = "waterPercentageEnable";
|
||||||
|
public static final String PREFERENCE_KEY_MUSCLE = "muscleEnable";
|
||||||
|
public static final String PREFERENCE_KEY_MUSCLE_PERCENTAGE = "musclePercentageEnable";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_WATER = "estimateWaterEnable";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_WATER_FORMULA = "estimateWaterFormula";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_LBW = "estimateLBWEnable";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_LBW_FORMULA = "estimateLBWFormula";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_FAT = "estimateFatEnable";
|
||||||
|
public static final String PREFERENCE_KEY_ESTIMATE_FAT_FORMULA = "estimateFatFormula";
|
||||||
|
|
||||||
public static final String PREFERENCE_KEY_RESET_ORDER = "resetOrder";
|
public static final String PREFERENCE_KEY_RESET_ORDER = "resetOrder";
|
||||||
public static final String PREFERENCE_KEY_MEASUREMENTS = "measurements";
|
public static final String PREFERENCE_KEY_ORDER_CATEGORY = "orderCategory";
|
||||||
|
|
||||||
private Preference deleteAll;
|
private Preference deleteAll;
|
||||||
private PreferenceCategory measurementCategory;
|
|
||||||
|
private PreferenceScreen measurementOrderScreen;
|
||||||
|
private PreferenceCategory measurementOrderCategory;
|
||||||
|
|
||||||
|
private CheckBoxPreference fatEnable;
|
||||||
|
private SwitchPreference fatPercentageEnable;
|
||||||
|
private CheckBoxPreference waterEnable;
|
||||||
|
private SwitchPreference waterPercentageEnable;
|
||||||
|
private CheckBoxPreference muscleEnable;
|
||||||
|
private SwitchPreference musclePercentageEnable;
|
||||||
|
|
||||||
|
private CheckBoxPreference estimateWaterEnable;
|
||||||
|
private ListPreference estimateWaterFormula;
|
||||||
|
private CheckBoxPreference estimateLBWEnable;
|
||||||
|
private ListPreference estimateLBWFormula;
|
||||||
|
private CheckBoxPreference estimateFatEnable;
|
||||||
|
private ListPreference estimateFatFormula;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -64,46 +94,204 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
|
|
||||||
addPreferencesFromResource(R.xml.measurement_preferences);
|
addPreferencesFromResource(R.xml.measurement_preferences);
|
||||||
|
|
||||||
deleteAll = findPreference(PREFERENCE_KEY_DELETE_ALL);
|
deleteAll = (Preference) findPreference(PREFERENCE_KEY_DELETE_ALL);
|
||||||
deleteAll.setOnPreferenceClickListener(new onClickListenerDeleteAll());
|
deleteAll.setOnPreferenceClickListener(new onClickListenerDeleteAll());
|
||||||
|
|
||||||
measurementCategory = (PreferenceCategory) findPreference(PREFERENCE_KEY_MEASUREMENTS);
|
final Context context = getActivity().getBaseContext();
|
||||||
|
measurementOrderScreen = (PreferenceScreen) findPreference(MeasurementView.PREF_MEASUREMENT_ORDER);
|
||||||
|
|
||||||
|
measurementOrderCategory = (PreferenceCategory) findPreference(PREFERENCE_KEY_ORDER_CATEGORY);
|
||||||
|
measurementOrderCategory.setOrderingAsAdded(true);
|
||||||
|
|
||||||
Preference resetOrder = findPreference(PREFERENCE_KEY_RESET_ORDER);
|
Preference resetOrder = findPreference(PREFERENCE_KEY_RESET_ORDER);
|
||||||
resetOrder.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
resetOrder.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceClick(Preference preference) {
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
PreferenceManager.getDefaultSharedPreferences(getActivity()).edit()
|
PreferenceManager.getDefaultSharedPreferences(context).edit()
|
||||||
.remove(MeasurementView.PREF_MEASUREMENT_ORDER).apply();
|
.remove(MeasurementView.PREF_MEASUREMENT_ORDER).commit();
|
||||||
updateMeasurementPreferences();
|
measurementOrderCategory.removeAll();
|
||||||
|
updateMeasurementOrderScreen(context, measurementOrderCategory);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
updateMeasurementPreferences();
|
updateMeasurementOrderScreen(context, measurementOrderCategory);
|
||||||
|
|
||||||
|
estimateWaterEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_ESTIMATE_WATER);
|
||||||
|
estimateWaterFormula = (ListPreference) findPreference(PREFERENCE_KEY_ESTIMATE_WATER_FORMULA);
|
||||||
|
estimateLBWEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_ESTIMATE_LBW);
|
||||||
|
estimateLBWFormula = (ListPreference) findPreference(PREFERENCE_KEY_ESTIMATE_LBW_FORMULA);
|
||||||
|
estimateFatEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_ESTIMATE_FAT);
|
||||||
|
estimateFatFormula = (ListPreference) findPreference(PREFERENCE_KEY_ESTIMATE_FAT_FORMULA);
|
||||||
|
|
||||||
|
fatEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_FAT);
|
||||||
|
fatPercentageEnable = (SwitchPreference) findPreference(PREFERENCE_KEY_FAT_PERCENTAGE);
|
||||||
|
waterEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_WATER);
|
||||||
|
waterPercentageEnable = (SwitchPreference) findPreference(PREFERENCE_KEY_WATER_PERCENTAGE);
|
||||||
|
muscleEnable = (CheckBoxPreference) findPreference(PREFERENCE_KEY_MUSCLE);
|
||||||
|
musclePercentageEnable = (SwitchPreference) findPreference(PREFERENCE_KEY_MUSCLE_PERCENTAGE);
|
||||||
|
|
||||||
|
updateWaterListPreferences();
|
||||||
|
updateLBWListPreferences();
|
||||||
|
updateFatListPreferences();
|
||||||
|
|
||||||
|
initSummary(getPreferenceScreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMeasurementPreferences() {
|
private void updateMeasurementOrderScreen(Context context, PreferenceCategory category) {
|
||||||
measurementCategory.removeAll();
|
|
||||||
|
|
||||||
List<MeasurementView> measurementViews = MeasurementView.getMeasurementList(
|
List<MeasurementView> measurementViews = MeasurementView.getMeasurementList(
|
||||||
getActivity(), MeasurementView.DateTimeOrder.NONE);
|
context, MeasurementView.DateTimeOrder.NONE);
|
||||||
|
|
||||||
for (MeasurementView measurement : measurementViews) {
|
for (MeasurementView measurement : measurementViews) {
|
||||||
Preference preference = new MeasurementOrderPreference(
|
Preference preference = new MeasurementOrderPreference(context, category, measurement);
|
||||||
getActivity(), measurementCategory, measurement);
|
preference.setShouldDisableView(true);
|
||||||
preference.setKey(measurement.getSettings().getEnabledKey());
|
preference.setEnabled(measurement.isVisible());
|
||||||
preference.setDefaultValue(measurement.getSettings().isEnabledIgnoringDependencies());
|
category.addPreference(preference);
|
||||||
preference.setPersistent(true);
|
}
|
||||||
preference.setEnabled(measurement.getSettings().areDependenciesEnabled());
|
}
|
||||||
|
|
||||||
Drawable icon = measurement.getIcon();
|
public void updateWaterListPreferences() {
|
||||||
icon.setColorFilter(measurement.getForegroundColor(), PorterDuff.Mode.SRC_IN);
|
ArrayList<String> listEntries = new ArrayList();
|
||||||
preference.setIcon(icon);
|
ArrayList<String> listEntryValues = new ArrayList();
|
||||||
|
|
||||||
preference.setTitle(measurement.getName());
|
for (EstimatedWaterMetric.FORMULA formulaWater : EstimatedWaterMetric.FORMULA.values()) {
|
||||||
|
EstimatedWaterMetric waterMetric = EstimatedWaterMetric.getEstimatedMetric(formulaWater);
|
||||||
|
|
||||||
measurementCategory.addPreference(preference);
|
listEntries.add(waterMetric.getName());
|
||||||
|
listEntryValues.add(formulaWater.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
estimateWaterFormula.setEntries(listEntries.toArray(new CharSequence[listEntries.size()]));
|
||||||
|
estimateWaterFormula.setEntryValues(listEntryValues.toArray(new CharSequence[listEntryValues.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateLBWListPreferences() {
|
||||||
|
ArrayList<String> listEntries = new ArrayList();
|
||||||
|
ArrayList<String> listEntryValues = new ArrayList();
|
||||||
|
|
||||||
|
for (EstimatedLBWMetric.FORMULA formulaLBW : EstimatedLBWMetric.FORMULA.values()) {
|
||||||
|
EstimatedLBWMetric muscleMetric = EstimatedLBWMetric.getEstimatedMetric(formulaLBW);
|
||||||
|
|
||||||
|
listEntries.add(muscleMetric.getName());
|
||||||
|
listEntryValues.add(formulaLBW.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
estimateLBWFormula.setEntries(listEntries.toArray(new CharSequence[listEntries.size()]));
|
||||||
|
estimateLBWFormula.setEntryValues(listEntryValues.toArray(new CharSequence[listEntryValues.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateFatListPreferences() {
|
||||||
|
ArrayList<String> listEntries = new ArrayList();
|
||||||
|
ArrayList<String> listEntryValues = new ArrayList();
|
||||||
|
|
||||||
|
for (EstimatedFatMetric.FORMULA formulaFat : EstimatedFatMetric.FORMULA.values()) {
|
||||||
|
EstimatedFatMetric fatMetric = EstimatedFatMetric.getEstimatedMetric(formulaFat);
|
||||||
|
|
||||||
|
listEntries.add(fatMetric.getName());
|
||||||
|
listEntryValues.add(formulaFat.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
estimateFatFormula.setEntries(listEntries.toArray(new CharSequence[listEntries.size()]));
|
||||||
|
estimateFatFormula.setEntryValues(listEntryValues.toArray(new CharSequence[listEntryValues.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initSummary(Preference p) {
|
||||||
|
if (p instanceof PreferenceGroup) {
|
||||||
|
PreferenceGroup pGrp = (PreferenceGroup) p;
|
||||||
|
for (int i = 0; i < pGrp.getPreferenceCount(); i++) {
|
||||||
|
initSummary(pGrp.getPreference(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
updatePrefSummary(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
|
||||||
|
super.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||||
|
updatePrefSummary(findPreference(key));
|
||||||
|
if (!key.equals(MeasurementView.PREF_MEASUREMENT_ORDER)) {
|
||||||
|
measurementOrderCategory.removeAll();
|
||||||
|
updateMeasurementOrderScreen(getActivity().getApplicationContext(), measurementOrderCategory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePrefSummary(Preference p) {
|
||||||
|
if (estimateWaterEnable.isChecked()) {
|
||||||
|
estimateWaterFormula.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
estimateWaterFormula.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estimateLBWEnable.isChecked()) {
|
||||||
|
estimateLBWFormula.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
estimateLBWFormula.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estimateFatEnable.isChecked()) {
|
||||||
|
estimateFatFormula.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
estimateFatFormula.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fatEnable.isChecked()) {
|
||||||
|
fatPercentageEnable.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
fatPercentageEnable.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (waterEnable.isChecked()) {
|
||||||
|
waterPercentageEnable.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
waterPercentageEnable.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muscleEnable.isChecked()) {
|
||||||
|
musclePercentageEnable.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
musclePercentageEnable.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
estimateWaterFormula.setSummary(EstimatedWaterMetric.getEstimatedMetric(EstimatedWaterMetric.FORMULA.valueOf(estimateWaterFormula.getValue())).getName());
|
||||||
|
estimateLBWFormula.setSummary(EstimatedLBWMetric.getEstimatedMetric(EstimatedLBWMetric.FORMULA.valueOf(estimateLBWFormula.getValue())).getName());
|
||||||
|
estimateFatFormula.setSummary(EstimatedFatMetric.getEstimatedMetric(EstimatedFatMetric.FORMULA.valueOf(estimateFatFormula.getValue())).getName());
|
||||||
|
|
||||||
|
if (p instanceof EditTextPreference) {
|
||||||
|
EditTextPreference editTextPref = (EditTextPreference) p;
|
||||||
|
if (p.getTitle().toString().contains("assword"))
|
||||||
|
{
|
||||||
|
p.setSummary("******");
|
||||||
|
} else {
|
||||||
|
p.setSummary(editTextPref.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p instanceof MultiSelectListPreference) {
|
||||||
|
MultiSelectListPreference editMultiListPref = (MultiSelectListPreference) p;
|
||||||
|
|
||||||
|
CharSequence[] entries = editMultiListPref.getEntries();
|
||||||
|
CharSequence[] entryValues = editMultiListPref.getEntryValues();
|
||||||
|
List<String> currentEntries = new ArrayList<>();
|
||||||
|
Set<String> currentEntryValues = editMultiListPref.getValues();
|
||||||
|
|
||||||
|
for (int i = 0; i < entries.length; i++)
|
||||||
|
if (currentEntryValues.contains(entryValues[i]))
|
||||||
|
currentEntries.add(entries[i].toString());
|
||||||
|
|
||||||
|
p.setSummary(currentEntries.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,25 +326,19 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MeasurementOrderPreference extends Preference
|
private class MeasurementOrderPreference extends Preference {
|
||||||
implements GestureDetector.OnGestureListener {
|
|
||||||
PreferenceGroup parentGroup;
|
PreferenceGroup parentGroup;
|
||||||
MeasurementView measurement;
|
MeasurementView measurement;
|
||||||
|
|
||||||
GestureDetector gestureDetector;
|
|
||||||
|
|
||||||
View boundView;
|
View boundView;
|
||||||
Switch measurementSwitch;
|
|
||||||
|
|
||||||
MeasurementOrderPreference(Context context, PreferenceGroup parent, MeasurementView measurementView) {
|
MeasurementOrderPreference(Context context, PreferenceGroup parent, MeasurementView measurementView) {
|
||||||
super(context);
|
super(context);
|
||||||
parentGroup = parent;
|
parentGroup = parent;
|
||||||
measurement = measurementView;
|
measurement = measurementView;
|
||||||
|
Drawable icon = measurement.getIcon();
|
||||||
gestureDetector = new GestureDetector(getContext(), this);
|
icon.setColorFilter(measurementView.getForegroundColor(), PorterDuff.Mode.SRC_IN);
|
||||||
gestureDetector.setIsLongpressEnabled(true);
|
setIcon(icon);
|
||||||
|
setTitle(measurement.getName());
|
||||||
setWidgetLayoutResource(R.layout.measurement_preferences_widget_layout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PreferenceGroup getParent() {
|
public PreferenceGroup getParent() {
|
||||||
@@ -168,125 +350,38 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
super.onBindView(view);
|
super.onBindView(view);
|
||||||
boundView = view;
|
boundView = view;
|
||||||
|
|
||||||
measurementSwitch = view.findViewById(R.id.measurement_switch);
|
onTouchClickListener touchClickListener = new onTouchClickListener(this);
|
||||||
if (measurement instanceof WeightMeasurementView) {
|
view.setOnTouchListener(touchClickListener);
|
||||||
measurementSwitch.setVisibility(View.INVISIBLE);
|
view.setOnLongClickListener(touchClickListener);
|
||||||
}
|
|
||||||
else {
|
|
||||||
measurementSwitch.setChecked(measurement.getSettings().isEnabledIgnoringDependencies());
|
|
||||||
measurementSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
||||||
persistBoolean(isChecked);
|
|
||||||
for (int i = 0; i < getParent().getPreferenceCount(); ++i) {
|
|
||||||
MeasurementOrderPreference preference =
|
|
||||||
(MeasurementOrderPreference) getParent().getPreference(i);
|
|
||||||
preference.setEnabled(preference.measurement.getSettings().areDependenciesEnabled());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!measurement.hasExtraPreferences()) {
|
|
||||||
view.findViewById(R.id.measurement_switch_separator).setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
TypedValue outValue = new TypedValue();
|
|
||||||
getActivity().getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
|
|
||||||
boundView.setBackgroundResource(outValue.resourceId);
|
|
||||||
|
|
||||||
view.setOnTouchListener(new View.OnTouchListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
|
||||||
return gestureDetector.onTouchEvent(event);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.setOnDragListener(new onDragListener());
|
view.setOnDragListener(new onDragListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private class onTouchClickListener implements View.OnTouchListener, View.OnLongClickListener {
|
||||||
public boolean onDown(MotionEvent e) {
|
MeasurementOrderPreference preference;
|
||||||
return isEnabled();
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
|
||||||
|
onTouchClickListener(MeasurementOrderPreference pref) {
|
||||||
|
preference = pref;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShowPress(MotionEvent e) {
|
public boolean onTouch(View view, MotionEvent event) {
|
||||||
boundView.setPressed(true);
|
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||||
|
x = Math.round(event.getX());
|
||||||
|
y = Math.round(event.getY());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
|
||||||
boundView.setPressed(false);
|
|
||||||
|
|
||||||
if (!measurement.hasExtraPreferences()) {
|
|
||||||
if (measurementSwitch.getVisibility() == View.VISIBLE) {
|
|
||||||
measurementSwitch.toggle();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be enabled to show extra preferences screen
|
|
||||||
if (!getPersistedBoolean(true)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
|
|
||||||
|
|
||||||
// Register as an observer so that the loop to getItem() below will find the new
|
|
||||||
// preference screen added at the end. The add is done on another thread so we must
|
|
||||||
// wait for it to complete.
|
|
||||||
final ListAdapter adapter = getPreferenceScreen().getRootAdapter();
|
|
||||||
adapter.registerDataSetObserver(new DataSetObserver() {
|
|
||||||
@Override
|
|
||||||
public void onChanged() {
|
|
||||||
adapter.unregisterDataSetObserver(this);
|
|
||||||
|
|
||||||
// Simulate a click to have the preference screen open
|
|
||||||
for (int i = adapter.getCount() - 1; i >= 0; --i) {
|
|
||||||
if (adapter.getItem(i) == screen) {
|
|
||||||
getPreferenceScreen().onItemClick(null, null, i, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the preference when the dialog is dismissed
|
|
||||||
Dialog dialog = screen.getDialog();
|
|
||||||
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
|
||||||
@Override
|
|
||||||
public void onDismiss(DialogInterface dialog) {
|
|
||||||
screen.onDismiss(dialog);
|
|
||||||
getPreferenceScreen().removePreference(screen);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
getPreferenceScreen().addPreference(screen);
|
|
||||||
measurement.prepareExtraPreferencesScreen(screen);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLongPress(MotionEvent event) {
|
public boolean onLongClick(View view) {
|
||||||
int x = Math.round(event.getX());
|
return view.startDrag(null, new dragShadowBuilder(view), preference, 0);
|
||||||
int y = Math.round(event.getY());
|
|
||||||
|
|
||||||
boundView.startDrag(null, new dragShadowBuilder(boundView, x, y), this, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class dragShadowBuilder extends View.DragShadowBuilder {
|
private class dragShadowBuilder extends View.DragShadowBuilder {
|
||||||
private int x;
|
public dragShadowBuilder(View view) {
|
||||||
private int y;
|
|
||||||
public dragShadowBuilder(View view, int x, int y) {
|
|
||||||
super(view);
|
super(view);
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -295,10 +390,6 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
outShadowTouchPoint.set(x, y);
|
outShadowTouchPoint.set(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class onDragListener implements View.OnDragListener {
|
private class onDragListener implements View.OnDragListener {
|
||||||
@@ -334,6 +425,9 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
public boolean onDrag(View view, DragEvent event) {
|
public boolean onDrag(View view, DragEvent event) {
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
case DragEvent.ACTION_DRAG_STARTED:
|
case DragEvent.ACTION_DRAG_STARTED:
|
||||||
|
if (isDraggedView(view, event)) {
|
||||||
|
setTemporaryBackgroundColor(view, Color.GRAY);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DragEvent.ACTION_DRAG_ENTERED:
|
case DragEvent.ACTION_DRAG_ENTERED:
|
||||||
if (!isDraggedView(view, event)) {
|
if (!isDraggedView(view, event)) {
|
||||||
@@ -381,5 +475,6 @@ public class MeasurementPreferences extends PreferenceFragment {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class BMIMeasurementView extends FloatMeasurementView {
|
public class BMIMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "bmi";
|
|
||||||
|
|
||||||
public BMIMeasurementView(Context context) {
|
public BMIMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_bmi), ContextCompat.getDrawable(context, R.drawable.ic_bmi));
|
super(context, context.getResources().getString(R.string.label_bmi), ContextCompat.getDrawable(context, R.drawable.ic_bmi));
|
||||||
@@ -33,7 +33,12 @@ public class BMIMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "bmi";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("weightEnable", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -27,7 +28,6 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class BMRMeasurementView extends FloatMeasurementView {
|
public class BMRMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "bmr";
|
|
||||||
|
|
||||||
public BMRMeasurementView(Context context) {
|
public BMRMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_bmr), ContextCompat.getDrawable(context, R.drawable.ic_bmr));
|
super(context, context.getResources().getString(R.string.label_bmr), ContextCompat.getDrawable(context, R.drawable.ic_bmr));
|
||||||
@@ -35,7 +35,12 @@ public class BMRMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "bmr";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("weightEnable", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class BoneMeasurementView extends FloatMeasurementView {
|
public class BoneMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "bone";
|
|
||||||
|
|
||||||
public BoneMeasurementView(Context context) {
|
public BoneMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_bone), ContextCompat.getDrawable(context, R.drawable.ic_bone));
|
super(context, context.getResources().getString(R.string.label_bone), ContextCompat.getDrawable(context, R.drawable.ic_bone));
|
||||||
@@ -33,7 +33,12 @@ public class BoneMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "bone";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("boneEnable", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
@@ -26,8 +27,6 @@ import com.health.openscale.R;
|
|||||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||||
|
|
||||||
public class CommentMeasurementView extends MeasurementView {
|
public class CommentMeasurementView extends MeasurementView {
|
||||||
public static final String KEY = "comment";
|
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
public CommentMeasurementView(Context context) {
|
public CommentMeasurementView(Context context) {
|
||||||
@@ -36,7 +35,7 @@ public class CommentMeasurementView extends MeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "comment";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setValue(String newComment, boolean callListener) {
|
private void setValue(String newComment, boolean callListener) {
|
||||||
@@ -56,11 +55,6 @@ public class CommentMeasurementView extends MeasurementView {
|
|||||||
measurement.setComment(comment);
|
measurement.setComment(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearIn(ScaleMeasurement measurement) {
|
|
||||||
measurement.setComment("");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreState(Bundle state) {
|
public void restoreState(Bundle state) {
|
||||||
setValue(state.getString(getKey()), true);
|
setValue(state.getString(getKey()), true);
|
||||||
@@ -71,6 +65,11 @@ public class CommentMeasurementView extends MeasurementView {
|
|||||||
state.putString(getKey(), comment);
|
state.putString(getKey(), comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
// Empty
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValueAsString() {
|
public String getValueAsString() {
|
||||||
return comment;
|
return comment;
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -29,8 +30,6 @@ import java.util.Calendar;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class DateMeasurementView extends MeasurementView {
|
public class DateMeasurementView extends MeasurementView {
|
||||||
public static final String KEY = "date";
|
|
||||||
|
|
||||||
private static DateFormat dateFormat = DateFormat.getDateInstance();
|
private static DateFormat dateFormat = DateFormat.getDateInstance();
|
||||||
private Date date;
|
private Date date;
|
||||||
|
|
||||||
@@ -40,9 +39,10 @@ public class DateMeasurementView extends MeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "date";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void setValue(Date newDate, boolean callListener) {
|
private void setValue(Date newDate, boolean callListener) {
|
||||||
if (!newDate.equals(date)) {
|
if (!newDate.equals(date)) {
|
||||||
date = newDate;
|
date = newDate;
|
||||||
@@ -71,11 +71,6 @@ public class DateMeasurementView extends MeasurementView {
|
|||||||
measurement.setDateTime(target.getTime());
|
measurement.setDateTime(target.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearIn(ScaleMeasurement measurement) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreState(Bundle state) {
|
public void restoreState(Bundle state) {
|
||||||
setValue(new Date(state.getLong(getKey())), true);
|
setValue(new Date(state.getLong(getKey())), true);
|
||||||
@@ -86,6 +81,11 @@ public class DateMeasurementView extends MeasurementView {
|
|||||||
state.putLong(getKey(), date.getTime());
|
state.putLong(getKey(), date.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
// Empty
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValueAsString() {
|
public String getValueAsString() {
|
||||||
return dateFormat.format(date);
|
return dateFormat.format(date);
|
||||||
|
@@ -16,18 +16,19 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.bodymetric.EstimatedFatMetric;
|
|
||||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||||
import com.health.openscale.core.evaluation.EvaluationResult;
|
import com.health.openscale.core.evaluation.EvaluationResult;
|
||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class FatMeasurementView extends FloatMeasurementView {
|
public class FatMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "fat";
|
|
||||||
|
private boolean estimateFatEnable;
|
||||||
|
private boolean percentageEnable;
|
||||||
|
|
||||||
public FatMeasurementView(Context context) {
|
public FatMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_fat), ContextCompat.getDrawable(context, R.drawable.ic_fat));
|
super(context, context.getResources().getString(R.string.label_fat), ContextCompat.getDrawable(context, R.drawable.ic_fat));
|
||||||
@@ -35,12 +36,19 @@ public class FatMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "fat";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canConvertPercentageToAbsoluteWeight() {
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
return true;
|
setVisible(preferences.getBoolean("fatEnable", true));
|
||||||
|
estimateFatEnable = preferences.getBoolean("estimateFatEnable", false);
|
||||||
|
percentageEnable = preferences.getBoolean("fatPercentageEnable", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldConvertPercentageToAbsoluteWeight() {
|
||||||
|
return !percentageEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,11 +63,11 @@ public class FatMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnit() {
|
public String getUnit() {
|
||||||
if (shouldConvertPercentageToAbsoluteWeight()) {
|
if (percentageEnable) {
|
||||||
return getScaleUser().getScaleUnit().toString();
|
return "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "%";
|
return getScaleUser().getScaleUnit().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,22 +81,8 @@ public class FatMeasurementView extends FloatMeasurementView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isEstimationSupported() { return true; }
|
protected boolean isEstimationEnabled() {
|
||||||
|
return estimateFatEnable;
|
||||||
@Override
|
|
||||||
protected void prepareEstimationFormulaPreference(ListPreference preference) {
|
|
||||||
String[] entries = new String[EstimatedFatMetric.FORMULA.values().length];
|
|
||||||
String[] values = new String[entries.length];
|
|
||||||
|
|
||||||
int idx = 0;
|
|
||||||
for (EstimatedFatMetric.FORMULA formula : EstimatedFatMetric.FORMULA.values()) {
|
|
||||||
entries[idx] = EstimatedFatMetric.getEstimatedMetric(formula).getName();
|
|
||||||
values[idx] = formula.name();
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
preference.setEntries(entries);
|
|
||||||
preference.setEntryValues(values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -17,16 +17,10 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.DataSetObserver;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceScreen;
|
|
||||||
import android.preference.SwitchPreference;
|
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
@@ -37,7 +31,6 @@ import android.view.View;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListAdapter;
|
|
||||||
import android.widget.TableRow;
|
import android.widget.TableRow;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -234,21 +227,18 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
|||||||
|
|
||||||
public abstract int getColor();
|
public abstract int getColor();
|
||||||
|
|
||||||
protected boolean isEstimationSupported() { return false; }
|
protected boolean isEstimationEnabled() {
|
||||||
protected void prepareEstimationFormulaPreference(ListPreference preference) {}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value);
|
protected abstract EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value);
|
||||||
|
|
||||||
private boolean useAutoValue() {
|
private boolean useAutoValue() {
|
||||||
return isEstimationSupported()
|
return isEstimationEnabled() && getMeasurementMode() == MeasurementViewMode.ADD;
|
||||||
&& getSettings().isEstimationEnabled()
|
|
||||||
&& getMeasurementMode() == MeasurementViewMode.ADD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canConvertPercentageToAbsoluteWeight() { return false; }
|
|
||||||
protected boolean shouldConvertPercentageToAbsoluteWeight() {
|
protected boolean shouldConvertPercentageToAbsoluteWeight() {
|
||||||
return canConvertPercentageToAbsoluteWeight()
|
return false;
|
||||||
&& !getSettings().isPercentageEnabled();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float makeAbsoluteWeight(float percentage) {
|
private float makeAbsoluteWeight(float percentage) {
|
||||||
@@ -322,11 +312,6 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearIn(ScaleMeasurement measurement) {
|
|
||||||
setMeasurementValue(0.0f, measurement);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreState(Bundle state) {
|
public void restoreState(Bundle state) {
|
||||||
setValue(state.getFloat(getKey()), previousValue, true);
|
setValue(state.getFloat(getKey()), previousValue, true);
|
||||||
@@ -419,70 +404,6 @@ public abstract class FloatMeasurementView extends MeasurementView {
|
|||||||
showEvaluatorRow(show);
|
showEvaluatorRow(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasExtraPreferences() { return true; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void prepareExtraPreferencesScreen(PreferenceScreen screen) {
|
|
||||||
MeasurementViewSettings settings = getSettings();
|
|
||||||
|
|
||||||
CheckBoxPreference overview = new CheckBoxPreference(screen.getContext());
|
|
||||||
overview.setKey(settings.getInOverviewGraphKey());
|
|
||||||
overview.setTitle(R.string.label_include_in_overview_graph);
|
|
||||||
overview.setPersistent(true);
|
|
||||||
overview.setDefaultValue(settings.isInOverviewGraph());
|
|
||||||
screen.addPreference(overview);
|
|
||||||
|
|
||||||
if (canConvertPercentageToAbsoluteWeight()) {
|
|
||||||
SwitchPreference percentage = new SwitchPreference(screen.getContext());
|
|
||||||
percentage.setKey(settings.getPercentageEnabledKey());
|
|
||||||
percentage.setTitle(R.string.label_measurement_in_percent);
|
|
||||||
percentage.setPersistent(true);
|
|
||||||
percentage.setDefaultValue(settings.isPercentageEnabled());
|
|
||||||
screen.addPreference(percentage);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEstimationSupported()) {
|
|
||||||
final CheckBoxPreference estimate = new CheckBoxPreference(screen.getContext());
|
|
||||||
estimate.setKey(settings.getEstimationEnabledKey());
|
|
||||||
estimate.setTitle(R.string.label_estimate_measurement);
|
|
||||||
estimate.setPersistent(true);
|
|
||||||
estimate.setDefaultValue(settings.isEstimationEnabled());
|
|
||||||
screen.addPreference(estimate);
|
|
||||||
|
|
||||||
final ListPreference formula = new ListPreference(screen.getContext());
|
|
||||||
formula.setKey(settings.getEstimationFormulaKey());
|
|
||||||
formula.setTitle(R.string.label_estimation_formula);
|
|
||||||
formula.setPersistent(true);
|
|
||||||
formula.setDefaultValue(settings.getEstimationFormula());
|
|
||||||
prepareEstimationFormulaPreference(formula);
|
|
||||||
formula.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
|
||||||
ListPreference list = (ListPreference) preference;
|
|
||||||
int idx = list.findIndexOfValue((String) newValue);
|
|
||||||
if (idx == -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
preference.setSummary(list.getEntries()[idx]);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
final ListAdapter adapter = screen.getRootAdapter();
|
|
||||||
adapter.registerDataSetObserver(new DataSetObserver() {
|
|
||||||
@Override
|
|
||||||
public void onChanged() {
|
|
||||||
adapter.unregisterDataSetObserver(this);
|
|
||||||
|
|
||||||
formula.setDependency(estimate.getKey());
|
|
||||||
formula.setSummary(formula.getEntry());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
screen.addPreference(formula);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private float validateAndGetInput(View view) {
|
private float validateAndGetInput(View view) {
|
||||||
EditText editText = view.findViewById(R.id.float_input);
|
EditText editText = view.findViewById(R.id.float_input);
|
||||||
String text = editText.getText().toString();
|
String text = editText.getText().toString();
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class HipMeasurementView extends FloatMeasurementView {
|
public class HipMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "hip";
|
|
||||||
|
|
||||||
public HipMeasurementView(Context context) {
|
public HipMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_hip), ContextCompat.getDrawable(context, R.drawable.ic_hip));
|
super(context, context.getResources().getString(R.string.label_hip), ContextCompat.getDrawable(context, R.drawable.ic_hip));
|
||||||
@@ -33,7 +33,12 @@ public class HipMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "hip";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("hipEnable", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,18 +16,18 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.bodymetric.EstimatedLBWMetric;
|
|
||||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||||
import com.health.openscale.core.evaluation.EvaluationResult;
|
import com.health.openscale.core.evaluation.EvaluationResult;
|
||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class LBWMeasurementView extends FloatMeasurementView {
|
public class LBWMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "lbw";
|
|
||||||
|
private boolean estimateLBWEnable;
|
||||||
|
|
||||||
public LBWMeasurementView(Context context) {
|
public LBWMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_lbw), ContextCompat.getDrawable(context, R.drawable.ic_lbw));
|
super(context, context.getResources().getString(R.string.label_lbw), ContextCompat.getDrawable(context, R.drawable.ic_lbw));
|
||||||
@@ -35,7 +35,13 @@ public class LBWMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "lbw";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("lbwEnable", false));
|
||||||
|
estimateLBWEnable = preferences.getBoolean("estimateLBWEnable", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,22 +70,8 @@ public class LBWMeasurementView extends FloatMeasurementView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isEstimationSupported() { return true; }
|
protected boolean isEstimationEnabled() {
|
||||||
|
return estimateLBWEnable;
|
||||||
@Override
|
|
||||||
protected void prepareEstimationFormulaPreference(ListPreference preference) {
|
|
||||||
String[] entries = new String[EstimatedLBWMetric.FORMULA.values().length];
|
|
||||||
String[] values = new String[entries.length];
|
|
||||||
|
|
||||||
int idx = 0;
|
|
||||||
for (EstimatedLBWMetric.FORMULA formula : EstimatedLBWMetric.FORMULA.values()) {
|
|
||||||
entries[idx] = EstimatedLBWMetric.getEstimatedMetric(formula).getName();
|
|
||||||
values[idx] = formula.name();
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
preference.setEntries(entries);
|
|
||||||
preference.setEntryValues(values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -23,7 +23,6 @@ import android.graphics.Color;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.preference.PreferenceScreen;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -31,6 +30,7 @@ import android.util.TypedValue;
|
|||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -61,8 +61,6 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
|
|
||||||
public static String PREF_MEASUREMENT_ORDER = "measurementOrder";
|
public static String PREF_MEASUREMENT_ORDER = "measurementOrder";
|
||||||
|
|
||||||
private MeasurementViewSettings settings;
|
|
||||||
|
|
||||||
private TableRow measurementRow;
|
private TableRow measurementRow;
|
||||||
private ImageView iconView;
|
private ImageView iconView;
|
||||||
private TextView nameView;
|
private TextView nameView;
|
||||||
@@ -77,11 +75,13 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
private MeasurementViewUpdateListener updateListener = null;
|
private MeasurementViewUpdateListener updateListener = null;
|
||||||
private MeasurementViewMode measurementMode = VIEW;
|
private MeasurementViewMode measurementMode = VIEW;
|
||||||
|
|
||||||
|
private static SharedPreferences prefs;
|
||||||
|
|
||||||
private boolean updateViews = true;
|
private boolean updateViews = true;
|
||||||
|
|
||||||
public MeasurementView(Context context, String text, Drawable icon) {
|
public MeasurementView(Context context, String text, Drawable icon) {
|
||||||
super(context);
|
super(context);
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
String app_theme = prefs.getString("app_theme", "Light");
|
String app_theme = prefs.getString("app_theme", "Light");
|
||||||
|
|
||||||
if (app_theme.equals("Dark")) {
|
if (app_theme.equals("Dark")) {
|
||||||
@@ -96,10 +96,7 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
|
|
||||||
public enum DateTimeOrder { FIRST, LAST, NONE }
|
public enum DateTimeOrder { FIRST, LAST, NONE }
|
||||||
|
|
||||||
public static final List<MeasurementView> getMeasurementList(
|
public static final List<MeasurementView> getMeasurementList(Context context, DateTimeOrder dateTimeOrder) {
|
||||||
Context context, DateTimeOrder dateTimeOrder) {
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
|
|
||||||
final List<MeasurementView> sorted = new ArrayList<>();
|
final List<MeasurementView> sorted = new ArrayList<>();
|
||||||
if (dateTimeOrder == DateTimeOrder.FIRST) {
|
if (dateTimeOrder == DateTimeOrder.FIRST) {
|
||||||
sorted.add(new DateMeasurementView(context));
|
sorted.add(new DateMeasurementView(context));
|
||||||
@@ -148,7 +145,7 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MeasurementView measurement : sorted) {
|
for (MeasurementView measurement : sorted) {
|
||||||
measurement.setVisible(measurement.getSettings().isEnabled());
|
measurement.updatePreferences(prefs);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sorted;
|
return sorted;
|
||||||
@@ -246,21 +243,14 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
|
|
||||||
public abstract String getKey();
|
public abstract String getKey();
|
||||||
|
|
||||||
public MeasurementViewSettings getSettings() {
|
|
||||||
if (settings == null) {
|
|
||||||
settings = new MeasurementViewSettings(
|
|
||||||
PreferenceManager.getDefaultSharedPreferences(getContext()), getKey());
|
|
||||||
}
|
|
||||||
return settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void loadFrom(ScaleMeasurement measurement, ScaleMeasurement previousMeasurement);
|
public abstract void loadFrom(ScaleMeasurement measurement, ScaleMeasurement previousMeasurement);
|
||||||
public abstract void saveTo(ScaleMeasurement measurement);
|
public abstract void saveTo(ScaleMeasurement measurement);
|
||||||
public abstract void clearIn(ScaleMeasurement measurement);
|
|
||||||
|
|
||||||
public abstract void restoreState(Bundle state);
|
public abstract void restoreState(Bundle state);
|
||||||
public abstract void saveState(Bundle state);
|
public abstract void saveState(Bundle state);
|
||||||
|
|
||||||
|
public abstract void updatePreferences(SharedPreferences preferences);
|
||||||
|
|
||||||
public CharSequence getName() { return nameView.getText(); }
|
public CharSequence getName() { return nameView.getText(); }
|
||||||
public abstract String getValueAsString();
|
public abstract String getValueAsString();
|
||||||
public void appendDiffValue(SpannableStringBuilder builder) { }
|
public void appendDiffValue(SpannableStringBuilder builder) { }
|
||||||
@@ -339,7 +329,7 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
showEvaluatorRow(false);
|
showEvaluatorRow(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVisible(boolean isVisible) {
|
protected void setVisible(boolean isVisible) {
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
measurementRow.setVisibility(View.VISIBLE);
|
measurementRow.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
@@ -391,9 +381,6 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
return openScale.getSelectedScaleUser();
|
return openScale.getSelectedScaleUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasExtraPreferences() { return false; }
|
|
||||||
public void prepareExtraPreferencesScreen(PreferenceScreen screen) { };
|
|
||||||
|
|
||||||
protected abstract View getInputView();
|
protected abstract View getInputView();
|
||||||
protected abstract boolean validateAndSetInput(View view);
|
protected abstract boolean validateAndSetInput(View view);
|
||||||
|
|
||||||
@@ -493,3 +480,4 @@ public abstract class MeasurementView extends TableLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,183 +0,0 @@
|
|||||||
/* Copyright (C) 2018 Erik Johansson <erik@ejohansson.se>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.health.openscale.gui.views;
|
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
|
|
||||||
import com.health.openscale.core.bodymetric.EstimatedFatMetric;
|
|
||||||
import com.health.openscale.core.bodymetric.EstimatedLBWMetric;
|
|
||||||
import com.health.openscale.core.bodymetric.EstimatedWaterMetric;
|
|
||||||
|
|
||||||
public class MeasurementViewSettings {
|
|
||||||
private SharedPreferences preferences;
|
|
||||||
private String key;
|
|
||||||
|
|
||||||
private static final String PREFERENCE_SUFFIX_ENABLE = "Enable";
|
|
||||||
private static final String PREFERENCE_SUFFIX_IN_OVERVIEW_GRAPH = "InOverviewGraph";
|
|
||||||
private static final String PREFERENCE_SUFFIX_IN_GRAPH = "InGraph";
|
|
||||||
private static final String PREFERENCE_SUFFIX_PERCENTAGE_ENABLE = "PercentageEnable";
|
|
||||||
private static final String PREFERENCE_SUFFIX_ESTIMATE_ENABLE = "EstimateEnable";
|
|
||||||
private static final String PREFERENCE_SUFFIX_ESTIMATE_FORMULA = "EstimateFormula";
|
|
||||||
|
|
||||||
public MeasurementViewSettings(SharedPreferences prefs, String key) {
|
|
||||||
preferences = prefs;
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getPreferenceKey(String suffix) {
|
|
||||||
return key + suffix;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEnabledKey() {
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabledIgnoringDependencies() {
|
|
||||||
boolean defaultValue;
|
|
||||||
switch (key) {
|
|
||||||
case WeightMeasurementView.KEY:
|
|
||||||
// Weight can't be disabled
|
|
||||||
return true;
|
|
||||||
case LBWMeasurementView.KEY:
|
|
||||||
case BoneMeasurementView.KEY:
|
|
||||||
case WaistMeasurementView.KEY:
|
|
||||||
case HipMeasurementView.KEY:
|
|
||||||
defaultValue = false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
defaultValue = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return preferences.getBoolean(getEnabledKey(), defaultValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isDependencyEnabled(String dependencyKey) {
|
|
||||||
// Weight can't be disabled
|
|
||||||
if (dependencyKey.equals(WeightMeasurementView.KEY)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (new MeasurementViewSettings(preferences, dependencyKey)).isEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean areDependenciesEnabled() {
|
|
||||||
switch (key) {
|
|
||||||
case BMIMeasurementView.KEY:
|
|
||||||
case BMRMeasurementView.KEY:
|
|
||||||
return isDependencyEnabled(WeightMeasurementView.KEY);
|
|
||||||
|
|
||||||
// Requires weight as they are stored as percentage of it
|
|
||||||
case FatMeasurementView.KEY:
|
|
||||||
case MuscleMeasurementView.KEY:
|
|
||||||
case WaterMeasurementView.KEY:
|
|
||||||
return isDependencyEnabled(WeightMeasurementView.KEY);
|
|
||||||
|
|
||||||
case WHRMeasurementView.KEY:
|
|
||||||
return isDependencyEnabled(HipMeasurementView.KEY)
|
|
||||||
&& isDependencyEnabled(WaistMeasurementView.KEY);
|
|
||||||
|
|
||||||
case WHtRMeasurementView.KEY:
|
|
||||||
return isDependencyEnabled(WaistMeasurementView.KEY);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return isEnabledIgnoringDependencies() && areDependenciesEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInOverviewGraphKey() {
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_IN_OVERVIEW_GRAPH);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInOverviewGraph() {
|
|
||||||
boolean defaultValue;
|
|
||||||
switch (key) {
|
|
||||||
case BMRMeasurementView.KEY:
|
|
||||||
defaultValue = false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
defaultValue = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return preferences.getBoolean(getInOverviewGraphKey(), defaultValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInGraphKey() {
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_IN_GRAPH);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isInGraph() {
|
|
||||||
return preferences.getBoolean(getInGraphKey(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPercentageEnabledKey() {
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_PERCENTAGE_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPercentageEnabled() {
|
|
||||||
return preferences.getBoolean(getPercentageEnabledKey(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEstimationEnabledKey() {
|
|
||||||
switch (key) {
|
|
||||||
case FatMeasurementView.KEY:
|
|
||||||
return "estimateFatEnable";
|
|
||||||
case LBWMeasurementView.KEY:
|
|
||||||
return "estimateLBWEnable";
|
|
||||||
case WaterMeasurementView.KEY:
|
|
||||||
return "estimateWaterEnable";
|
|
||||||
}
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_ESTIMATE_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEstimationEnabled() {
|
|
||||||
return preferences.getBoolean(getEstimationEnabledKey(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEstimationFormulaKey() {
|
|
||||||
switch (key) {
|
|
||||||
case FatMeasurementView.KEY:
|
|
||||||
return "estimateFatFormula";
|
|
||||||
case LBWMeasurementView.KEY:
|
|
||||||
return "estimateLBWFormula";
|
|
||||||
case WaterMeasurementView.KEY:
|
|
||||||
return "estimateWaterFormula";
|
|
||||||
}
|
|
||||||
return getPreferenceKey(PREFERENCE_SUFFIX_ESTIMATE_FORMULA);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEstimationFormula() {
|
|
||||||
String defaultValue;
|
|
||||||
switch (key) {
|
|
||||||
case FatMeasurementView.KEY:
|
|
||||||
defaultValue = EstimatedFatMetric.FORMULA.BF_GALLAGHER.name();
|
|
||||||
break;
|
|
||||||
case LBWMeasurementView.KEY:
|
|
||||||
defaultValue = EstimatedLBWMetric.FORMULA.LBW_HUME.name();
|
|
||||||
break;
|
|
||||||
case WaterMeasurementView.KEY:
|
|
||||||
defaultValue = EstimatedWaterMetric.FORMULA.TBW_LEESONGKIM.name();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
defaultValue = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return preferences.getString(getEstimationFormulaKey(), defaultValue);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,8 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class MuscleMeasurementView extends FloatMeasurementView {
|
public class MuscleMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "muscle";
|
|
||||||
|
private boolean percentageEnable;
|
||||||
|
|
||||||
public MuscleMeasurementView(Context context) {
|
public MuscleMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_muscle), ContextCompat.getDrawable(context, R.drawable.ic_muscle));
|
super(context, context.getResources().getString(R.string.label_muscle), ContextCompat.getDrawable(context, R.drawable.ic_muscle));
|
||||||
@@ -33,12 +35,18 @@ public class MuscleMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "muscle";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canConvertPercentageToAbsoluteWeight() {
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
return true;
|
setVisible(preferences.getBoolean("muscleEnable", true));
|
||||||
|
percentageEnable = preferences.getBoolean("musclePercentageEnable", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldConvertPercentageToAbsoluteWeight() {
|
||||||
|
return !percentageEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -53,11 +61,11 @@ public class MuscleMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnit() {
|
public String getUnit() {
|
||||||
if (shouldConvertPercentageToAbsoluteWeight()) {
|
if (percentageEnable) {
|
||||||
return getScaleUser().getScaleUnit().toString();
|
return "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "%";
|
return getScaleUser().getScaleUnit().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -29,8 +30,6 @@ import java.util.Calendar;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class TimeMeasurementView extends MeasurementView {
|
public class TimeMeasurementView extends MeasurementView {
|
||||||
public static final String KEY = "time";
|
|
||||||
|
|
||||||
private DateFormat timeFormat;
|
private DateFormat timeFormat;
|
||||||
private Date time;
|
private Date time;
|
||||||
|
|
||||||
@@ -41,7 +40,7 @@ public class TimeMeasurementView extends MeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "time";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setValue(Date newTime, boolean callListener) {
|
private void setValue(Date newTime, boolean callListener) {
|
||||||
@@ -74,11 +73,6 @@ public class TimeMeasurementView extends MeasurementView {
|
|||||||
measurement.setDateTime(target.getTime());
|
measurement.setDateTime(target.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearIn(ScaleMeasurement measurement) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreState(Bundle state) {
|
public void restoreState(Bundle state) {
|
||||||
setValue(new Date(state.getLong(getKey())), true);
|
setValue(new Date(state.getLong(getKey())), true);
|
||||||
@@ -89,6 +83,11 @@ public class TimeMeasurementView extends MeasurementView {
|
|||||||
state.putLong(getKey(), time.getTime());
|
state.putLong(getKey(), time.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
// Empty
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getValueAsString() {
|
public String getValueAsString() {
|
||||||
return timeFormat.format(time);
|
return timeFormat.format(time);
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class WHRMeasurementView extends FloatMeasurementView {
|
public class WHRMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "whr";
|
|
||||||
|
|
||||||
public WHRMeasurementView(Context context) {
|
public WHRMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_whr), ContextCompat.getDrawable(context, R.drawable.ic_whr));
|
super(context, context.getResources().getString(R.string.label_whr), ContextCompat.getDrawable(context, R.drawable.ic_whr));
|
||||||
@@ -33,7 +33,13 @@ public class WHRMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "whr";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("hipEnable", false)
|
||||||
|
&& preferences.getBoolean("waistEnable", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class WHtRMeasurementView extends FloatMeasurementView {
|
public class WHtRMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "whtr";
|
|
||||||
|
|
||||||
public WHtRMeasurementView(Context context) {
|
public WHtRMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_whtr), ContextCompat.getDrawable(context, R.drawable.ic_whtr));
|
super(context, context.getResources().getString(R.string.label_whtr), ContextCompat.getDrawable(context, R.drawable.ic_whtr));
|
||||||
@@ -33,7 +33,12 @@ public class WHtRMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "whtr";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("waistEnable", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ import com.health.openscale.core.evaluation.EvaluationResult;
|
|||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class WaistMeasurementView extends FloatMeasurementView {
|
public class WaistMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "waist";
|
|
||||||
|
|
||||||
public WaistMeasurementView(Context context) {
|
public WaistMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_waist), ContextCompat.getDrawable(context, R.drawable.ic_waist));
|
super(context, context.getResources().getString(R.string.label_waist), ContextCompat.getDrawable(context, R.drawable.ic_waist));
|
||||||
@@ -33,7 +33,12 @@ public class WaistMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "waist";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("waistEnable", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,18 +16,19 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.bodymetric.EstimatedWaterMetric;
|
|
||||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||||
import com.health.openscale.core.evaluation.EvaluationResult;
|
import com.health.openscale.core.evaluation.EvaluationResult;
|
||||||
import com.health.openscale.core.evaluation.EvaluationSheet;
|
import com.health.openscale.core.evaluation.EvaluationSheet;
|
||||||
|
|
||||||
public class WaterMeasurementView extends FloatMeasurementView {
|
public class WaterMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "water";
|
|
||||||
|
private boolean estimateWaterEnable;
|
||||||
|
private boolean percentageEnable;
|
||||||
|
|
||||||
public WaterMeasurementView(Context context) {
|
public WaterMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_water), ContextCompat.getDrawable(context, R.drawable.ic_water));
|
super(context, context.getResources().getString(R.string.label_water), ContextCompat.getDrawable(context, R.drawable.ic_water));
|
||||||
@@ -35,12 +36,19 @@ public class WaterMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "water";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canConvertPercentageToAbsoluteWeight() {
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
return true;
|
setVisible(preferences.getBoolean("waterEnable", true));
|
||||||
|
estimateWaterEnable = preferences.getBoolean("estimateWaterEnable", false);
|
||||||
|
percentageEnable = preferences.getBoolean("waterPercentageEnable", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldConvertPercentageToAbsoluteWeight() {
|
||||||
|
return !percentageEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,11 +63,11 @@ public class WaterMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getUnit() {
|
public String getUnit() {
|
||||||
if (shouldConvertPercentageToAbsoluteWeight()) {
|
if (percentageEnable) {
|
||||||
return getScaleUser().getScaleUnit().toString();
|
return "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "%";
|
return getScaleUser().getScaleUnit().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,22 +81,8 @@ public class WaterMeasurementView extends FloatMeasurementView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isEstimationSupported() { return true; }
|
protected boolean isEstimationEnabled() {
|
||||||
|
return estimateWaterEnable;
|
||||||
@Override
|
|
||||||
protected void prepareEstimationFormulaPreference(ListPreference preference) {
|
|
||||||
String[] entries = new String[EstimatedWaterMetric.FORMULA.values().length];
|
|
||||||
String[] values = new String[entries.length];
|
|
||||||
|
|
||||||
int idx = 0;
|
|
||||||
for (EstimatedWaterMetric.FORMULA formula : EstimatedWaterMetric.FORMULA.values()) {
|
|
||||||
entries[idx] = EstimatedWaterMetric.getEstimatedMetric(formula).getName();
|
|
||||||
values[idx] = formula.name();
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
preference.setEntries(entries);
|
|
||||||
preference.setEntryValues(values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
package com.health.openscale.gui.views;
|
package com.health.openscale.gui.views;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
|
||||||
@@ -26,7 +27,6 @@ import com.health.openscale.core.evaluation.EvaluationSheet;
|
|||||||
import com.health.openscale.core.utils.Converters;
|
import com.health.openscale.core.utils.Converters;
|
||||||
|
|
||||||
public class WeightMeasurementView extends FloatMeasurementView {
|
public class WeightMeasurementView extends FloatMeasurementView {
|
||||||
public static final String KEY = "weight";
|
|
||||||
|
|
||||||
public WeightMeasurementView(Context context) {
|
public WeightMeasurementView(Context context) {
|
||||||
super(context, context.getResources().getString(R.string.label_weight), ContextCompat.getDrawable(context, R.drawable.ic_weight));
|
super(context, context.getResources().getString(R.string.label_weight), ContextCompat.getDrawable(context, R.drawable.ic_weight));
|
||||||
@@ -34,7 +34,12 @@ public class WeightMeasurementView extends FloatMeasurementView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return KEY;
|
return "weight";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updatePreferences(SharedPreferences preferences) {
|
||||||
|
setVisible(preferences.getBoolean("weightEnable", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/measurement_switch_separator"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?android:attr/listDivider" />
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/measurement_switch"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_weight="1" />
|
|
||||||
</LinearLayout>
|
|
@@ -113,12 +113,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Confirmació d\'eliminació</string>
|
<string name="label_delete_confirmation">Confirmació d\'eliminació</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Estimació d\'aigua corporal</string>
|
||||||
|
<string name="label_estimate_lbw">Estimació de massa corporal magra</string>
|
||||||
|
<string name="label_estimate_fat">Estimació de greix corporal</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Mostreu</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Estimació de mètriques corporals</string>
|
||||||
<string name="label_category_measurement_database">Base de dades de mesures</string>
|
<string name="label_category_measurement_database">Base de dades de mesures</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Responsable</string>
|
<string name="label_maintainer">Responsable</string>
|
||||||
<string name="label_website">Pàgina Web</string>
|
<string name="label_website">Pàgina Web</string>
|
||||||
<string name="label_license">Llicència</string>
|
<string name="label_license">Llicència</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Fórmula d\'aigua corporal</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Fórmula de massa corporal magra</string>
|
||||||
|
<string name="label_estimate_fat_formula">Fórmula de greix corporal</string>
|
||||||
<string name="label_automatic">automàtic</string>
|
<string name="label_automatic">automàtic</string>
|
||||||
|
|
||||||
<string name="label_reminder">Recordatori</string>
|
<string name="label_reminder">Recordatori</string>
|
||||||
|
@@ -29,6 +29,10 @@
|
|||||||
<string name="label_comment">Komentář</string>
|
<string name="label_comment">Komentář</string>
|
||||||
<string name="label_smartUserAssign">Chytré přiřazení uživatele</string>
|
<string name="label_smartUserAssign">Chytré přiřazení uživatele</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Tělesný tuk v %</string>
|
||||||
|
<string name="label_water_percentage">Tělesná voda v %</string>
|
||||||
|
<string name="label_muscle_percentage">Svalová hmota v %</string>
|
||||||
|
|
||||||
<plurals name="label_days">
|
<plurals name="label_days">
|
||||||
<item quantity="one">%d den</item>
|
<item quantity="one">%d den</item>
|
||||||
<item quantity="few">%d dny</item>
|
<item quantity="few">%d dny</item>
|
||||||
@@ -96,6 +100,10 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Potvrzení smazání</string>
|
<string name="label_delete_confirmation">Potvrzení smazání</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Odhadnout vodu v těle</string>
|
||||||
|
<string name="label_estimate_fat">Odhadnout tělesný tuk</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Zobrazit</string>
|
||||||
<string name="label_maintainer">Správce</string>
|
<string name="label_maintainer">Správce</string>
|
||||||
<string name="label_website">Webové stránky</string>
|
<string name="label_website">Webové stránky</string>
|
||||||
<string name="label_license">Licence</string>
|
<string name="label_license">Licence</string>
|
||||||
|
@@ -122,7 +122,15 @@
|
|||||||
<string name="error_max_scale_users">Maximale Anzahl gleichzeitiger Benutzer erreicht</string>
|
<string name="error_max_scale_users">Maximale Anzahl gleichzeitiger Benutzer erreicht</string>
|
||||||
<string name="info_step_on_scale">Bitte steigen Sie barfuß auf die Waage zur Referenzmessung</string>
|
<string name="info_step_on_scale">Bitte steigen Sie barfuß auf die Waage zur Referenzmessung</string>
|
||||||
<string name="label_automatic">auto</string>
|
<string name="label_automatic">auto</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Körpermetriken abschätzen</string>
|
||||||
|
<string name="label_category_display">Anzeige</string>
|
||||||
<string name="label_category_measurement_database">Messwertedatenbank</string>
|
<string name="label_category_measurement_database">Messwertedatenbank</string>
|
||||||
|
<string name="label_estimate_fat">Körperfettschätzung</string>
|
||||||
|
<string name="label_estimate_fat_formula">Körperfettformel</string>
|
||||||
|
<string name="label_estimate_water">Körperwasserschätzung</string>
|
||||||
|
<string name="label_estimate_water_formula">Körperwasserformel</string>
|
||||||
|
<string name="label_estimate_lbw">Fettfreie Körpermassenschätzung</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Fettfreie Körpermassenformel</string>
|
||||||
<string name="label_lbw">Fettfreie Körpermasse</string>
|
<string name="label_lbw">Fettfreie Körpermasse</string>
|
||||||
<string name="label_license">Lizenz</string>
|
<string name="label_license">Lizenz</string>
|
||||||
<string name="label_maintainer">Hauptentwickler</string>
|
<string name="label_maintainer">Hauptentwickler</string>
|
||||||
@@ -132,6 +140,9 @@
|
|||||||
<string name="close_drawer">schließen</string>
|
<string name="close_drawer">schließen</string>
|
||||||
<string name="info_bluetooth_no_device_set">Kein Bluetooth Gerät ausgewählt</string>
|
<string name="info_bluetooth_no_device_set">Kein Bluetooth Gerät ausgewählt</string>
|
||||||
<string name="info_new_data_duplicated">Messung mit gleichen Datum und Uhrzeit exisitiert bereits</string>
|
<string name="info_new_data_duplicated">Messung mit gleichen Datum und Uhrzeit exisitiert bereits</string>
|
||||||
|
<string name="label_fat_percentage">Körperfett in %</string>
|
||||||
|
<string name="label_water_percentage">Wasseranteil in %</string>
|
||||||
|
<string name="label_muscle_percentage">Muskelanteil in %</string>
|
||||||
<string name="label_feedback_message_enjoying">Gefällt Dir openScale?</string>
|
<string name="label_feedback_message_enjoying">Gefällt Dir openScale?</string>
|
||||||
<string name="label_feedback_message_rate_app">Wie wäre es dann mit einer Bewertung bei GooglePlay oder bei GitHub?</string>
|
<string name="label_feedback_message_rate_app">Wie wäre es dann mit einer Bewertung bei GooglePlay oder bei GitHub?</string>
|
||||||
<string name="label_feedback_message_yes">Ja!</string>
|
<string name="label_feedback_message_yes">Ja!</string>
|
||||||
@@ -163,6 +174,7 @@
|
|||||||
<string name="permission_bluetooth_info">openScale benötigt die Erlaubnis, auf den ungefähren Standort zuzugreifen, um nach Bluetooth-Geräten suchen zu können.</string>
|
<string name="permission_bluetooth_info">openScale benötigt die Erlaubnis, auf den ungefähren Standort zuzugreifen, um nach Bluetooth-Geräten suchen zu können.</string>
|
||||||
<string name="permission_bluetooth_info_title">Information</string>
|
<string name="permission_bluetooth_info_title">Information</string>
|
||||||
<string name="label_next">Weiter</string>
|
<string name="label_next">Weiter</string>
|
||||||
|
<string name="label_measurement_order">Messwert Reihenfolge</string>
|
||||||
<string name="label_press_hold_reorder">Halten Sie die Taste gedrückt, um die Reihenfolge zu ändern</string>
|
<string name="label_press_hold_reorder">Halten Sie die Taste gedrückt, um die Reihenfolge zu ändern</string>
|
||||||
<string name="label_set_default_order">Default Reihenfolge wiederherstellen</string>
|
<string name="label_set_default_order">Default Reihenfolge wiederherstellen</string>
|
||||||
<string name="label_share_subject">openScale CSV Datenexport (%s)</string>
|
<string name="label_share_subject">openScale CSV Datenexport (%s)</string>
|
||||||
|
@@ -113,12 +113,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Confirmación de borrado</string>
|
<string name="label_delete_confirmation">Confirmación de borrado</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Estimación de agua corporal</string>
|
||||||
|
<string name="label_estimate_lbw">Estimación de masa corporal magra</string>
|
||||||
|
<string name="label_estimate_fat">Estimación de grasa coporal</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Mostrar</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Estimación de métricas corporales</string>
|
||||||
<string name="label_category_measurement_database">Base de datos de mediciones</string>
|
<string name="label_category_measurement_database">Base de datos de mediciones</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Responsable</string>
|
<string name="label_maintainer">Responsable</string>
|
||||||
<string name="label_website">Página Web</string>
|
<string name="label_website">Página Web</string>
|
||||||
<string name="label_license">Licencia</string>
|
<string name="label_license">Licencia</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Fórmula de agua corporal</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Fórmula de masa corporal magra</string>
|
||||||
|
<string name="label_estimate_fat_formula">Fórmula de grasa corporal</string>
|
||||||
<string name="label_automatic">automático</string>
|
<string name="label_automatic">automático</string>
|
||||||
|
|
||||||
<string name="label_reminder">Recordatorio</string>
|
<string name="label_reminder">Recordatorio</string>
|
||||||
@@ -160,6 +169,10 @@
|
|||||||
|
|
||||||
<string name="label_share">Compartir</string>
|
<string name="label_share">Compartir</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Grasa corporal en %</string>
|
||||||
|
<string name="label_water_percentage">Porcentaje de agua en %</string>
|
||||||
|
<string name="label_muscle_percentage">Porcentaje muscular en %</string>
|
||||||
|
|
||||||
<string name="error_user_name_too_short">Error: el nombre de usuario tiene que tener al menos 3 carácteres</string>
|
<string name="error_user_name_too_short">Error: el nombre de usuario tiene que tener al menos 3 carácteres</string>
|
||||||
<string name="info_bluetooth_no_device_set">"No hay dispositivo Bluetooth seleccionado "</string>
|
<string name="info_bluetooth_no_device_set">"No hay dispositivo Bluetooth seleccionado "</string>
|
||||||
<string name="info_new_data_duplicated">Medición con al misma fecha y hora ya existe</string>
|
<string name="info_new_data_duplicated">Medición con al misma fecha y hora ya existe</string>
|
||||||
|
@@ -115,12 +115,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Bevestiging verwijderen</string>
|
<string name="label_delete_confirmation">Bevestiging verwijderen</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Geschat vochtmassa</string>
|
||||||
|
<string name="label_estimate_lbw">Geschat vetvrije massa</string>
|
||||||
|
<string name="label_estimate_fat">Geschat vetmassa</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Scherm</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Schatting Lichaamssamenstelling</string>
|
||||||
<string name="label_category_measurement_database">Metingen database</string>
|
<string name="label_category_measurement_database">Metingen database</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Beheerder</string>
|
<string name="label_maintainer">Beheerder</string>
|
||||||
<string name="label_website">Website</string>
|
<string name="label_website">Website</string>
|
||||||
<string name="label_license">Licentie</string>
|
<string name="label_license">Licentie</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Formule vochtmassa</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Formule vetvrije massa</string>
|
||||||
|
<string name="label_estimate_fat_formula">Formule vetmassa</string>
|
||||||
<string name="label_automatic">auto</string>
|
<string name="label_automatic">auto</string>
|
||||||
|
|
||||||
<string name="label_reminder">Herinnering</string>
|
<string name="label_reminder">Herinnering</string>
|
||||||
@@ -160,6 +169,10 @@
|
|||||||
<string name="label_share">Delen</string>
|
<string name="label_share">Delen</string>
|
||||||
<string name="label_share_subject">openScale CSV data exporteren (%s)</string>
|
<string name="label_share_subject">openScale CSV data exporteren (%s)</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Lichaamsvet in %</string>
|
||||||
|
<string name="label_water_percentage">Lichaamsvocht in %</string>
|
||||||
|
<string name="label_muscle_percentage">Spiermassa in %</string>
|
||||||
|
|
||||||
<string name="error_user_name_too_short">Fout: Gebruikersnaam dient minimaal 3 karakters lang te zijn</string>
|
<string name="error_user_name_too_short">Fout: Gebruikersnaam dient minimaal 3 karakters lang te zijn</string>
|
||||||
<string name="info_bluetooth_no_device_set">Geen Bluetooth apparaat geselecteerd</string>
|
<string name="info_bluetooth_no_device_set">Geen Bluetooth apparaat geselecteerd</string>
|
||||||
<string name="info_new_data_duplicated">Meting met een zelfde datum en tijd bestaat al</string>
|
<string name="info_new_data_duplicated">Meting met een zelfde datum en tijd bestaat al</string>
|
||||||
@@ -201,6 +214,7 @@
|
|||||||
<string name="permission_bluetooth_info">openScale heeft toestemming nodig tot uw locatie om te kunnen zoeken naar Bluetooth apparaten</string>
|
<string name="permission_bluetooth_info">openScale heeft toestemming nodig tot uw locatie om te kunnen zoeken naar Bluetooth apparaten</string>
|
||||||
<string name="permission_bluetooth_info_title">Informatie</string>
|
<string name="permission_bluetooth_info_title">Informatie</string>
|
||||||
<string name="label_next">Volgende</string>
|
<string name="label_next">Volgende</string>
|
||||||
|
<string name="label_measurement_order">Meting volgorde</string>
|
||||||
<string name="label_press_hold_reorder">Indrukken en vasthouden om opnieuw in te delen</string>
|
<string name="label_press_hold_reorder">Indrukken en vasthouden om opnieuw in te delen</string>
|
||||||
<string name="label_set_default_order">Stel standaard volgorde in</string>
|
<string name="label_set_default_order">Stel standaard volgorde in</string>
|
||||||
<string name="label_export_overwrite">Vorige export \"%s\" overschrijven?</string>
|
<string name="label_export_overwrite">Vorige export \"%s\" overschrijven?</string>
|
||||||
|
@@ -39,6 +39,10 @@
|
|||||||
<string name="label_bone">Masa kostna</string>
|
<string name="label_bone">Masa kostna</string>
|
||||||
<string name="label_smartUserAssign">Inteligente przypisywanie użytkowników</string>
|
<string name="label_smartUserAssign">Inteligente przypisywanie użytkowników</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Tkanka tłusczowa w %</string>
|
||||||
|
<string name="label_water_percentage">Woda w organizmie w %</string>
|
||||||
|
<string name="label_muscle_percentage">Masa mięśniowa w %</string>
|
||||||
|
|
||||||
<plurals name="label_days">
|
<plurals name="label_days">
|
||||||
<item quantity="other">%d dni</item>
|
<item quantity="other">%d dni</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
@@ -122,12 +126,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Potwierdzenie usnięcia</string>
|
<string name="label_delete_confirmation">Potwierdzenie usnięcia</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Wznaczaj procent wody w organizmie</string>
|
||||||
|
<string name="label_estimate_lbw">Wyznaczaj beztłuszczową masę ciała</string>
|
||||||
|
<string name="label_estimate_fat">Wyznaczaj procent tkanki tłuszczowej</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Wyświetl</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Wyznaczanie wskaźników dla ciała</string>
|
||||||
<string name="label_category_measurement_database">Baza pomiarów</string>
|
<string name="label_category_measurement_database">Baza pomiarów</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Opiekun</string>
|
<string name="label_maintainer">Opiekun</string>
|
||||||
<string name="label_website">Strona internetowa</string>
|
<string name="label_website">Strona internetowa</string>
|
||||||
<string name="label_license">Licencja</string>
|
<string name="label_license">Licencja</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Formuła wyznaczania wody w organizmie</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Formuła wyznaczania beztłuszczowej masy ciała</string>
|
||||||
|
<string name="label_estimate_fat_formula">Formuła wyznaczania tkanki tłuszczowej</string>
|
||||||
<string name="label_automatic">auto</string>
|
<string name="label_automatic">auto</string>
|
||||||
|
|
||||||
<string name="label_theme">Motyw</string>
|
<string name="label_theme">Motyw</string>
|
||||||
@@ -192,6 +205,7 @@
|
|||||||
<string name="permission_bluetooth_info">openScale requires permission to access the coarse location to search for Bluetooth devices</string>
|
<string name="permission_bluetooth_info">openScale requires permission to access the coarse location to search for Bluetooth devices</string>
|
||||||
<string name="permission_bluetooth_info_title">Informacje</string>
|
<string name="permission_bluetooth_info_title">Informacje</string>
|
||||||
<string name="label_next">Następny</string>
|
<string name="label_next">Następny</string>
|
||||||
|
<string name="label_measurement_order">Kolejność pomiarów</string>
|
||||||
<string name="label_press_hold_reorder">Naciśnij i przytrzymaj by zmienić kolejność</string>
|
<string name="label_press_hold_reorder">Naciśnij i przytrzymaj by zmienić kolejność</string>
|
||||||
<string name="label_set_default_order">Ustaw domyślną kolejność</string>
|
<string name="label_set_default_order">Ustaw domyślną kolejność</string>
|
||||||
<string name="label_export_overwrite">Nadpisać poprzedni eksport \"%s\"?</string>
|
<string name="label_export_overwrite">Nadpisać poprzedni eksport \"%s\"?</string>
|
||||||
|
@@ -129,13 +129,20 @@
|
|||||||
<string name="label_share">Zdieľať</string>
|
<string name="label_share">Zdieľať</string>
|
||||||
<string name="label_share_subject">openScale CSV export údajov (%s)</string>
|
<string name="label_share_subject">openScale CSV export údajov (%s)</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Telesný tuk v %</string>
|
||||||
|
<string name="label_water_percentage">Voda v tele v %</string>
|
||||||
|
<string name="label_muscle_percentage">Svalstvo v %</string>
|
||||||
|
|
||||||
<string name="error_user_name_too_short">Chyba: používateľské meno musí obsahovať minimálne 3 znaky</string>
|
<string name="error_user_name_too_short">Chyba: používateľské meno musí obsahovať minimálne 3 znaky</string>
|
||||||
<string name="info_bluetooth_no_device_set">Nevybrali ste žiadne bluetooth zariadenie</string>
|
<string name="info_bluetooth_no_device_set">Nevybrali ste žiadne bluetooth zariadenie</string>
|
||||||
<string name="info_new_data_duplicated">meranie s rovnakým dátumom a časom už existuje</string>
|
<string name="info_new_data_duplicated">meranie s rovnakým dátumom a časom už existuje</string>
|
||||||
|
|
||||||
<string name="label_mergeWithLastMeasurement">Zlúčiť s posledným meraním</string>
|
<string name="label_mergeWithLastMeasurement">Zlúčiť s posledným meraním</string>
|
||||||
<string name="label_bluetooth_searching_finished">Hľadanie bluetooth váh sa dokončilo</string>
|
<string name="label_bluetooth_searching_finished">Hľadanie bluetooth váh sa dokončilo</string>
|
||||||
|
<string name="label_estimate_water">Odhadnúť vodu v tele</string>
|
||||||
|
<string name="label_estimate_fat">Odhadnúť telesný tuk</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Zobraziť</string>
|
||||||
<string name="label_category_measurement_database">Databáza meraní</string>
|
<string name="label_category_measurement_database">Databáza meraní</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Správca</string>
|
<string name="label_maintainer">Správca</string>
|
||||||
@@ -178,6 +185,7 @@
|
|||||||
<string name="permission_bluetooth_info">openScale vyžaduje povolenie prístupu k približnej polohe na vyhľadávanie bluetooth zariadení</string>
|
<string name="permission_bluetooth_info">openScale vyžaduje povolenie prístupu k približnej polohe na vyhľadávanie bluetooth zariadení</string>
|
||||||
<string name="permission_bluetooth_info_title">Informácie</string>
|
<string name="permission_bluetooth_info_title">Informácie</string>
|
||||||
<string name="label_next">Ďalej</string>
|
<string name="label_next">Ďalej</string>
|
||||||
|
<string name="label_measurement_order">Radenie meraní</string>
|
||||||
<string name="label_press_hold_reorder">Stlačte a podržte pre zmenu radenia</string>
|
<string name="label_press_hold_reorder">Stlačte a podržte pre zmenu radenia</string>
|
||||||
<string name="label_set_default_order">Nastaviť predvolené radenie</string>
|
<string name="label_set_default_order">Nastaviť predvolené radenie</string>
|
||||||
<string name="label_export_overwrite">Prepísať predchádzajúci export \"%s\"?</string>
|
<string name="label_export_overwrite">Prepísať predchádzajúci export \"%s\"?</string>
|
||||||
|
@@ -109,8 +109,16 @@
|
|||||||
<string name="label_enable_labels">Etikett på datapunkt</string>
|
<string name="label_enable_labels">Etikett på datapunkt</string>
|
||||||
<string name="label_enable_points">Punkt på datapunkt</string>
|
<string name="label_enable_points">Punkt på datapunkt</string>
|
||||||
<string name="label_delete_confirmation">Borttagningsbekräftelse</string>
|
<string name="label_delete_confirmation">Borttagningsbekräftelse</string>
|
||||||
|
<string name="label_estimate_water">Estimera kroppsvatten</string>
|
||||||
|
<string name="label_estimate_lbw">Estimera fettfri kroppsvikt</string>
|
||||||
|
<string name="label_estimate_fat">Estimera kroppsfett</string>
|
||||||
|
<string name="label_category_display">Visa</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Uppskatta mätvärden</string>
|
||||||
<string name="label_category_measurement_database">Mätningsdatabas</string>
|
<string name="label_category_measurement_database">Mätningsdatabas</string>
|
||||||
<string name="label_maintainer">Utvecklare</string>
|
<string name="label_maintainer">Utvecklare</string>
|
||||||
|
<string name="label_estimate_water_formula">Formel för kroppsvatten</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Formel för fettfri kroppsvikt</string>
|
||||||
|
<string name="label_estimate_fat_formula">Formel för kroppsfett</string>
|
||||||
<string name="label_automatic">auto</string>
|
<string name="label_automatic">auto</string>
|
||||||
<string name="label_reminder">Påminnelse</string>
|
<string name="label_reminder">Påminnelse</string>
|
||||||
<string name="label_reminder_notify_text">Meddelandetext</string>
|
<string name="label_reminder_notify_text">Meddelandetext</string>
|
||||||
@@ -130,6 +138,9 @@
|
|||||||
<string name="info_measuring">Mäter vikt: %.2f</string>
|
<string name="info_measuring">Mäter vikt: %.2f</string>
|
||||||
<string name="open_drawer">öppna</string>
|
<string name="open_drawer">öppna</string>
|
||||||
<string name="close_drawer">stäng</string>
|
<string name="close_drawer">stäng</string>
|
||||||
|
<string name="label_fat_percentage">Kroppsfett i %</string>
|
||||||
|
<string name="label_muscle_percentage">Muskler i %</string>
|
||||||
|
<string name="label_water_percentage">Kroppsvatten i %</string>
|
||||||
<string name="info_bluetooth_no_device_set">Ingen Bluetooth-enhet vald</string>
|
<string name="info_bluetooth_no_device_set">Ingen Bluetooth-enhet vald</string>
|
||||||
<string name="info_new_data_duplicated">mätning med samma datum och tid existerar redan</string>
|
<string name="info_new_data_duplicated">mätning med samma datum och tid existerar redan</string>
|
||||||
<string name="title_general">Allmänt</string>
|
<string name="title_general">Allmänt</string>
|
||||||
@@ -169,6 +180,7 @@
|
|||||||
<string name="label_share_subject">openScale CSV dataexport (%s)</string>
|
<string name="label_share_subject">openScale CSV dataexport (%s)</string>
|
||||||
|
|
||||||
<string name="label_next">Nästa</string>
|
<string name="label_next">Nästa</string>
|
||||||
|
<string name="label_measurement_order">Mätordning</string>
|
||||||
<string name="label_press_hold_reorder">Tryck och håll för att ändra ordning</string>
|
<string name="label_press_hold_reorder">Tryck och håll för att ändra ordning</string>
|
||||||
<string name="label_set_default_order">Ställ in standardordning</string>
|
<string name="label_set_default_order">Ställ in standardordning</string>
|
||||||
|
|
||||||
|
@@ -111,12 +111,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Delete confirmation</string>
|
<string name="label_delete_confirmation">Delete confirmation</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Tahmini Vücüt suyu oraný</string>
|
||||||
|
<string name="label_estimate_lbw">Tahmini Yaðsýz vücüt oraný</string>
|
||||||
|
<string name="label_estimate_fat">Tahmini Vücüt yað oraný</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Display</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Vücüt ölçütleri tahmini</string>
|
||||||
<string name="label_category_measurement_database">Ölçüm veritabaný</string>
|
<string name="label_category_measurement_database">Ölçüm veritabaný</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Maintainer</string>
|
<string name="label_maintainer">Maintainer</string>
|
||||||
<string name="label_website">Websitesi</string>
|
<string name="label_website">Websitesi</string>
|
||||||
<string name="label_license">Lisan</string>
|
<string name="label_license">Lisan</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Vücüt oraný hesaplama formulü</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Yað oraný hesaplama formulü</string>
|
||||||
|
<string name="label_estimate_fat_formula">Vücut yaðý formülü</string>
|
||||||
<string name="label_automatic">otomatik</string>
|
<string name="label_automatic">otomatik</string>
|
||||||
|
|
||||||
<string name="label_reminder">Hatýrlatma</string>
|
<string name="label_reminder">Hatýrlatma</string>
|
||||||
|
@@ -40,6 +40,10 @@
|
|||||||
<string name="label_bone">Bone mass</string>
|
<string name="label_bone">Bone mass</string>
|
||||||
<string name="label_smartUserAssign">Smart User assignment</string>
|
<string name="label_smartUserAssign">Smart User assignment</string>
|
||||||
|
|
||||||
|
<string name="label_fat_percentage">Body fat in %</string>
|
||||||
|
<string name="label_water_percentage">Body water in %</string>
|
||||||
|
<string name="label_muscle_percentage">Muscle in %</string>
|
||||||
|
|
||||||
<plurals name="label_days">
|
<plurals name="label_days">
|
||||||
<item quantity="one">%d day</item>
|
<item quantity="one">%d day</item>
|
||||||
<item quantity="other">%d days</item>
|
<item quantity="other">%d days</item>
|
||||||
@@ -123,12 +127,21 @@
|
|||||||
|
|
||||||
<string name="label_delete_confirmation">Delete confirmation</string>
|
<string name="label_delete_confirmation">Delete confirmation</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water">Estimate body water</string>
|
||||||
|
<string name="label_estimate_lbw">Estimate lean body weight</string>
|
||||||
|
<string name="label_estimate_fat">Estimate body fat</string>
|
||||||
|
|
||||||
|
<string name="label_category_display">Display</string>
|
||||||
|
<string name="label_category_body_metrics_estimation">Body metrics estimation</string>
|
||||||
<string name="label_category_measurement_database">Measurement database</string>
|
<string name="label_category_measurement_database">Measurement database</string>
|
||||||
|
|
||||||
<string name="label_maintainer">Maintainer</string>
|
<string name="label_maintainer">Maintainer</string>
|
||||||
<string name="label_website">Website</string>
|
<string name="label_website">Website</string>
|
||||||
<string name="label_license">License</string>
|
<string name="label_license">License</string>
|
||||||
|
|
||||||
|
<string name="label_estimate_water_formula">Body water formula</string>
|
||||||
|
<string name="label_estimate_lbw_formula">Lean body weight formula</string>
|
||||||
|
<string name="label_estimate_fat_formula">Body fat formula</string>
|
||||||
<string name="label_automatic">auto</string>
|
<string name="label_automatic">auto</string>
|
||||||
|
|
||||||
<string name="label_theme">Theme</string>
|
<string name="label_theme">Theme</string>
|
||||||
@@ -193,11 +206,10 @@
|
|||||||
<string name="permission_bluetooth_info">openScale requires permission to access the coarse location to search for Bluetooth devices</string>
|
<string name="permission_bluetooth_info">openScale requires permission to access the coarse location to search for Bluetooth devices</string>
|
||||||
<string name="permission_bluetooth_info_title">Information</string>
|
<string name="permission_bluetooth_info_title">Information</string>
|
||||||
<string name="label_next">Next</string>
|
<string name="label_next">Next</string>
|
||||||
|
<string name="label_measurement_order">Measurement order</string>
|
||||||
<string name="label_press_hold_reorder">Press and hold to reorder</string>
|
<string name="label_press_hold_reorder">Press and hold to reorder</string>
|
||||||
<string name="label_set_default_order">Set default order</string>
|
<string name="label_set_default_order">Set default order</string>
|
||||||
<string name="label_export_overwrite">Overwrite previous export \"%s\"?</string>
|
<string name="label_export_overwrite">Overwrite previous export \"%s\"?</string>
|
||||||
<string name="label_include_in_overview_graph">Include in overview graph</string>
|
|
||||||
<string name="label_measurement_in_percent">Measurement in %</string>
|
|
||||||
<string name="label_estimate_measurement">Estimate measurement</string>
|
|
||||||
<string name="label_estimation_formula">Estimation formula</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -1,7 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<PreferenceCategory android:title="@string/label_category_display">
|
||||||
|
<PreferenceScreen android:title="@string/label_measurement_order" android:key="measurementOrder">
|
||||||
<Preference android:key="resetOrder" android:title="@string/label_set_default_order"/>
|
<Preference android:key="resetOrder" android:title="@string/label_set_default_order"/>
|
||||||
<PreferenceCategory android:title="@string/label_press_hold_reorder" android:key="measurements" />
|
<PreferenceCategory android:key="orderCategory" android:title="@string/label_press_hold_reorder"/>
|
||||||
|
</PreferenceScreen>
|
||||||
|
<CheckBoxPreference android:title="@string/label_fat" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="fatEnable" android:defaultValue="true"/>
|
||||||
|
<SwitchPreference android:title="@string/label_fat_percentage" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key ="fatPercentageEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_water" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="waterEnable" android:defaultValue="true"/>
|
||||||
|
<SwitchPreference android:title="@string/label_water_percentage" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key ="waterPercentageEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_muscle" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="muscleEnable" android:defaultValue="true"/>
|
||||||
|
<SwitchPreference android:title="@string/label_muscle_percentage" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key ="musclePercentageEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_lbw" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="lbwEnable" android:defaultValue="false"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_bone" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="boneEnable" android:defaultValue="false"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_waist" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="waistEnable" android:defaultValue="false"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_hip" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="hipEnable" android:defaultValue="false"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="@string/label_category_body_metrics_estimation">
|
||||||
|
<CheckBoxPreference android:title="@string/label_estimate_water" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="estimateWaterEnable" android:defaultValue="false"/>
|
||||||
|
<ListPreference android:title="@string/label_estimate_water_formula" android:key="estimateWaterFormula" android:defaultValue="TBW_LEESONGKIM"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_estimate_lbw" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="estimateLBWEnable" android:defaultValue="false"/>
|
||||||
|
<ListPreference android:title="@string/label_estimate_lbw_formula" android:key="estimateLBWFormula" android:defaultValue="LBW_HUME"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_estimate_fat" android:summaryOn="@string/info_is_enable" android:summaryOff="@string/info_is_not_enable" android:key="estimateFatEnable" android:defaultValue="false"/>
|
||||||
|
<ListPreference android:title="@string/label_estimate_fat_formula" android:key="estimateFatFormula" android:defaultValue="BF_GALLAGHER"/>
|
||||||
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/label_category_measurement_database">
|
<PreferenceCategory android:title="@string/label_category_measurement_database">
|
||||||
<Preference android:title="@string/label_delete_all" android:key="deleteAll"></Preference>
|
<Preference android:title="@string/label_delete_all" android:key="deleteAll"></Preference>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
Reference in New Issue
Block a user