diff --git a/CREDITS b/CREDITS index e271cae9..f515f561 100644 --- a/CREDITS +++ b/CREDITS @@ -60,7 +60,9 @@ License: http://creativecommons.org/licenses/by/3.0/ * Madebyoliver (https://www.flaticon.com/authors/madebyoliver) * Those Icons (https://www.flaticon.com/authors/those-icons) * Smashicons (https://www.flaticon.com/authors/smashicons) -* Swifticons https://www.flaticon.com/authors/swifticons +* Swifticons (https://www.flaticon.com/authors/swifticons) +* Darius Dan (https://www.flaticon.com/authors/darius-dan) +* Pixelmeetup (https://www.flaticon.com/authors/pixelmeetup) Contributors to openScale are listed on: https://github.com/oliexdev/openScale/graphs/contributors diff --git a/android_app/app/schemas/com.health.openscale.core.database.AppDatabase/3.json b/android_app/app/schemas/com.health.openscale.core.database.AppDatabase/3.json new file mode 100644 index 00000000..b238f019 --- /dev/null +++ b/android_app/app/schemas/com.health.openscale.core.database.AppDatabase/3.json @@ -0,0 +1,243 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "d64c7b69a0b7a1a0f93dd154a24b20f2", + "entities": [ + { + "tableName": "scaleMeasurements", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `userId` INTEGER NOT NULL, `enabled` INTEGER NOT NULL, `datetime` INTEGER, `weight` REAL NOT NULL, `fat` REAL NOT NULL, `water` REAL NOT NULL, `muscle` REAL NOT NULL, `visceralFat` REAL NOT NULL, `lbw` REAL NOT NULL, `waist` REAL NOT NULL, `hip` REAL NOT NULL, `bone` REAL NOT NULL, `chest` REAL NOT NULL, `thigh` REAL NOT NULL, `biceps` REAL NOT NULL, `neck` REAL NOT NULL, `caliper1` REAL NOT NULL, `caliper2` REAL NOT NULL, `caliper3` REAL NOT NULL, `comment` TEXT, FOREIGN KEY(`userId`) REFERENCES `scaleUsers`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userId", + "columnName": "userId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "enabled", + "columnName": "enabled", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateTime", + "columnName": "datetime", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "weight", + "columnName": "weight", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "fat", + "columnName": "fat", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "water", + "columnName": "water", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "muscle", + "columnName": "muscle", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "visceralFat", + "columnName": "visceralFat", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "lbm", + "columnName": "lbw", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "waist", + "columnName": "waist", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "hip", + "columnName": "hip", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "bone", + "columnName": "bone", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "chest", + "columnName": "chest", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "thigh", + "columnName": "thigh", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "biceps", + "columnName": "biceps", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "neck", + "columnName": "neck", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "caliper1", + "columnName": "caliper1", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "caliper2", + "columnName": "caliper2", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "caliper3", + "columnName": "caliper3", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "comment", + "columnName": "comment", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_scaleMeasurements_userId_datetime", + "unique": true, + "columnNames": [ + "userId", + "datetime" + ], + "createSql": "CREATE UNIQUE INDEX `index_scaleMeasurements_userId_datetime` ON `${TABLE_NAME}` (`userId`, `datetime`)" + } + ], + "foreignKeys": [ + { + "table": "scaleUsers", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "userId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "scaleUsers", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `birthday` INTEGER, `bodyHeight` INTEGER NOT NULL, `scaleUnit` INTEGER NOT NULL, `gender` INTEGER NOT NULL, `initialWeight` REAL NOT NULL, `goalWeight` REAL NOT NULL, `goalDate` INTEGER)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "userName", + "columnName": "username", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "birthday", + "columnName": "birthday", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "bodyHeight", + "columnName": "bodyHeight", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "scaleUnit", + "columnName": "scaleUnit", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "gender", + "columnName": "gender", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "initialWeight", + "columnName": "initialWeight", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "goalWeight", + "columnName": "goalWeight", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "goalDate", + "columnName": "goalDate", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + } + ], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"d64c7b69a0b7a1a0f93dd154a24b20f2\")" + ] + } +} \ No newline at end of file diff --git a/android_app/app/src/main/java/com/health/openscale/core/OpenScale.java b/android_app/app/src/main/java/com/health/openscale/core/OpenScale.java index b0f292dc..485856e0 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/OpenScale.java +++ b/android_app/app/src/main/java/com/health/openscale/core/OpenScale.java @@ -137,7 +137,7 @@ public class OpenScale { db.setForeignKeyConstraintsEnabled(true); } }) - .addMigrations(AppDatabase.MIGRATION_1_2) + .addMigrations(AppDatabase.MIGRATION_1_2, AppDatabase.MIGRATION_2_3) .build(); measurementDAO = appDB.measurementDAO(); userDAO = appDB.userDAO(); diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothDigooDGSO38H.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothDigooDGSO38H.java index f6d3a17a..e0130cba 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothDigooDGSO38H.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothDigooDGSO38H.java @@ -86,8 +86,8 @@ public class BluetoothDigooDGSO38H extends BluetoothCommunication { } private void parseBytes(byte[] weightBytes) { - float weight, fat, water, muscle, boneWeight; - //float subcutaneousFat, visceralFat, metabolicBaseRate, biologicalAge, boneWeight; + float weight, fat, water, muscle, boneWeight, visceralFat; + //float subcutaneousFat, metabolicBaseRate, biologicalAge, boneWeight; final byte ctrlByte = weightBytes[5]; final boolean allValues = isBitSet(ctrlByte, 1); @@ -125,19 +125,19 @@ public class BluetoothDigooDGSO38H extends BluetoothCommunication { "is done, but fat is still zero. Settling for just adding weight."); } else { //subcutaneousFat = (float) (((weightBytes[8] & 0xFF) << 8) | (weightBytes[9] & 0xFF)) / 10.0f; - //visceralFat = (float) (weightBytes[10] & 0xFF) / 10.0f; + visceralFat = (float) (weightBytes[10] & 0xFF) / 10.0f; water = (float) (((weightBytes[11] & 0xFF) << 8) | (weightBytes[12] & 0xFF)) / 10.0f; //metabolicBaseRate = (float) (((weightBytes[13] & 0xFF) << 8) | (weightBytes[14] & 0xFF)); //biologicalAge = (float) (weightBytes[15] & 0xFF) + 1; muscle = (float) (((weightBytes[16] & 0xFF) << 8) | (weightBytes[17] & 0xFF)) / 10.0f; boneWeight = (float) (weightBytes[18] & 0xFF) / 10.0f; - //TODO: Add extra measurements? scaleBtData.setDateTime(new Date()); scaleBtData.setFat(fat); scaleBtData.setMuscle(muscle); scaleBtData.setWater(water); scaleBtData.setBone(boneWeight); + scaleBtData.setVisceralFat(visceralFat); } scaleBtData.setWeight(weight); addScaleData(scaleBtData); diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothExcelvanCF369BLE.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothExcelvanCF369BLE.java index 2a97074d..8ff48172 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothExcelvanCF369BLE.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothExcelvanCF369BLE.java @@ -128,6 +128,7 @@ public class BluetoothExcelvanCF369BLE extends BluetoothCommunication { scaleBtData.setMuscle(muscle); scaleBtData.setWater(water); scaleBtData.setBone(bone); + scaleBtData.setVisceralFat(visceralFat); addScaleData(scaleBtData); } diff --git a/android_app/app/src/main/java/com/health/openscale/core/database/AppDatabase.java b/android_app/app/src/main/java/com/health/openscale/core/database/AppDatabase.java index f4d74e89..814dfc90 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/database/AppDatabase.java +++ b/android_app/app/src/main/java/com/health/openscale/core/database/AppDatabase.java @@ -26,7 +26,7 @@ import com.health.openscale.core.datatypes.ScaleMeasurement; import com.health.openscale.core.datatypes.ScaleUser; import com.health.openscale.core.utils.Converters; -@Database(entities = {ScaleMeasurement.class, ScaleUser.class}, version = 2) +@Database(entities = {ScaleMeasurement.class, ScaleUser.class}, version = 3) @TypeConverters({Converters.class}) public abstract class AppDatabase extends RoomDatabase { public abstract ScaleMeasurementDAO measurementDAO(); @@ -75,5 +75,27 @@ public abstract class AppDatabase extends RoomDatabase { } } }; + + public static final Migration MIGRATION_2_3 = new Migration(2, 3) { + @Override + public void migrate(SupportSQLiteDatabase database) { + database.beginTransaction(); + try { + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN visceralFat REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN chest REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN thigh REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN biceps REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN neck REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN caliper1 REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN caliper2 REAL NOT NULL DEFAULT 0"); + database.execSQL("ALTER TABLE scaleMeasurements ADD COLUMN caliper3 REAL NOT NULL DEFAULT 0"); + + database.setTransactionSuccessful(); + } + finally { + database.endTransaction(); + } + } + }; } diff --git a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java index 769e5652..b3622818 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java +++ b/android_app/app/src/main/java/com/health/openscale/core/datatypes/ScaleMeasurement.java @@ -62,6 +62,9 @@ public class ScaleMeasurement implements Cloneable { @ColumnInfo(name = "muscle") private float muscle; @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "visceralFat") + private float visceralFat; + @CsvColumn(mustBeSupplied = false) @ColumnInfo(name = "lbw") private float lbm; @CsvColumn(mustBeSupplied = false) @@ -74,6 +77,27 @@ public class ScaleMeasurement implements Cloneable { @ColumnInfo(name = "bone") private float bone; @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "chest") + private float chest; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "thigh") + private float thigh; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "biceps") + private float biceps; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "neck") + private float neck; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "caliper1") + private float caliper1; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "caliper2") + private float caliper2; + @CsvColumn(mustBeSupplied = false) + @ColumnInfo(name = "caliper3") + private float caliper3; + @CsvColumn(mustBeSupplied = false) @ColumnInfo(name = "comment") private String comment; @@ -90,6 +114,13 @@ public class ScaleMeasurement implements Cloneable { bone = 0.0f; waist = 0.0f; hip = 0.0f; + chest = 0.0f; + thigh = 0.0f; + biceps = 0.0f; + neck = 0.0f; + caliper1 = 0.0f; + caliper2 = 0.0f; + caliper3 = 0.0f; comment = ""; } @@ -232,6 +263,14 @@ public class ScaleMeasurement implements Cloneable { this.muscle = muscle; } + public float getVisceralFat() { + return visceralFat; + } + + public void setVisceralFat(float visceralFat) { + this.visceralFat = visceralFat; + } + public float getLbm() { return lbm; } @@ -260,6 +299,62 @@ public class ScaleMeasurement implements Cloneable { public void setBone(float bone) {this.bone = bone; } + public float getChest() { + return chest; + } + + public void setChest(float chest) { + this.chest = chest; + } + + public float getThigh() { + return thigh; + } + + public void setThigh(float thigh) { + this.thigh = thigh; + } + + public float getBiceps() { + return biceps; + } + + public void setBiceps(float biceps) { + this.biceps = biceps; + } + + public float getNeck() { + return neck; + } + + public void setNeck(float neck) { + this.neck = neck; + } + + public float getCaliper1() { + return caliper1; + } + + public void setCaliper1(float caliper1) { + this.caliper1 = caliper1; + } + + public float getCaliper2() { + return caliper2; + } + + public void setCaliper2(float caliper2) { + this.caliper2 = caliper2; + } + + public float getCaliper3() { + return caliper3; + } + + public void setCaliper3(float caliper3) { + this.caliper3 = caliper3; + } + public String getComment() { return comment; } @@ -297,13 +392,39 @@ public class ScaleMeasurement implements Cloneable { return waist / hip; } + public float getFatCaliper(ScaleUser scaleUser) { + float fat_caliper; + + float k0, k1, k2, ka; + + float s = caliper1 + caliper2 + caliper3; + + if (scaleUser.getGender().isMale()) { + k0 = 1.10938f; + k1 = 0.0008267f; + k2 = 0.0000016f; + ka = 0.0002574f; + } else { + k0 = 1.0994921f; + k1 = 0.0009929f; + k2 = 0.0000023f; + ka = 0.0001392f; + } + + // calipometrie formula by Jackson, Pollock: Generalized equations for predicting body density of women. In: British Journal of Nutrition. Nr.40, Oktober 1978, S.497–504 + fat_caliper = ((4.95f / (k0 - (k1*s) + (k2 * s*s) - (ka*scaleUser.getAge()))) - 4.5f) * 100.0f; + + return fat_caliper; + } + @Override public String toString() { return String.format( "ID: %d, USER_ID: %d, DATE_TIME: %s, WEIGHT: %.2f, FAT: %.2f, WATER: %.2f, " + - "MUSCLE: %.2f, LBM: %.2f, WAIST: %.2f, HIP: %.2f, BONE: %.2f, COMMENT: %s", + "MUSCLE: %.2f, LBM: %.2f, WAIST: %.2f, HIP: %.2f, BONE: %.2f, CHEST: %.2f, " + + "THIGH: %.2f, ARM: %.2f, NECK: %.2f, CALIPER1: %2.f, CALIPER2: %2.f, CALIPER3: %2.f, COMMENT: %s", id, userId, dateTime.toString(), weight, fat, water, - muscle, lbm, waist, hip, bone, comment); + muscle, lbm, waist, hip, bone, chest, thigh, biceps, neck, caliper1, caliper2, caliper3, comment); } } diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/BicepsMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/BicepsMeasurementView.java new file mode 100644 index 00000000..09cae984 --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/BicepsMeasurementView.java @@ -0,0 +1,68 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class BicepsMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "biceps"; + + public BicepsMeasurementView(Context context) { + super(context, R.string.label_biceps, R.drawable.ic_biceps); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getBiceps(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setBiceps(value); + } + + @Override + public String getUnit() { + return "cm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#c0ca33"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper1MeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper1MeasurementView.java new file mode 100644 index 00000000..4cfc6990 --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper1MeasurementView.java @@ -0,0 +1,72 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class Caliper1MeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "caliper1"; + + public Caliper1MeasurementView(Context context) { + super(context, R.string.label_caliper1_female, R.drawable.ic_caliper1); + + if (getScaleUser().getGender().isMale()) { + setNameView(getResources().getText(R.string.label_caliper1_male)); + } + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getCaliper1(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setCaliper1(value); + } + + @Override + public String getUnit() { + return "mm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#ba68c8"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper2MeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper2MeasurementView.java new file mode 100644 index 00000000..479b9f9f --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper2MeasurementView.java @@ -0,0 +1,72 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class Caliper2MeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "caliper2"; + + public Caliper2MeasurementView(Context context) { + super(context, R.string.label_caliper2_female, R.drawable.ic_caliper2); + + if (getScaleUser().getGender().isMale()) { + setNameView(getResources().getText(R.string.label_caliper2_male)); + } + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getCaliper2(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setCaliper2(value); + } + + @Override + public String getUnit() { + return "mm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#ce93d8"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper3MeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper3MeasurementView.java new file mode 100644 index 00000000..a6919389 --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/Caliper3MeasurementView.java @@ -0,0 +1,72 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class Caliper3MeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "caliper3"; + + public Caliper3MeasurementView(Context context) { + super(context, R.string.label_caliper3_female, R.drawable.ic_caliper3); + + if (getScaleUser().getGender().isMale()) { + setNameView(getResources().getText(R.string.label_caliper3_male)); + } + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getCaliper3(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setCaliper3(value); + } + + @Override + public String getUnit() { + return "mm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#e1bee7"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/ChestMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/ChestMeasurementView.java new file mode 100644 index 00000000..db9ba93d --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/ChestMeasurementView.java @@ -0,0 +1,68 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class ChestMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "chest"; + + public ChestMeasurementView(Context context) { + super(context, R.string.label_chest, R.drawable.ic_chest); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getChest(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setChest(value); + } + + @Override + public String getUnit() { + return "cm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#1e88e5"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/FatCaliperMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/FatCaliperMeasurementView.java new file mode 100644 index 00000000..272c9266 --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/FatCaliperMeasurementView.java @@ -0,0 +1,82 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class FatCaliperMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "fat_caliper"; + + public FatCaliperMeasurementView(Context context) { + super(context, R.string.label_fat_caliper, R.drawable.ic_fat_caliper); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + public boolean isEditable() { + return false; + } + + @Override + protected boolean supportsPercentageToAbsoluteWeightConversion() { + return true; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getFatCaliper(getScaleUser()); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + + } + + @Override + public String getUnit() { + if (shouldConvertPercentageToAbsoluteWeight()) { + return getScaleUser().getScaleUnit().toString(); + } + + return "%"; + } + + @Override + protected float getMaxValue() { + return maybeConvertPercentageToAbsoluteWeight(80); + } + + @Override + public int getColor() { + return Color.parseColor("#f3e5f5"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return evalSheet.evaluateBodyFat(value); + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/FloatMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/FloatMeasurementView.java index d40b0814..86ff51af 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/views/FloatMeasurementView.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/FloatMeasurementView.java @@ -68,7 +68,7 @@ public abstract class FloatMeasurementView extends MeasurementView { private float userConvertedWeight; private EvaluationResult evaluationResult; - private final String nameText; + private String nameText; private Button incButton; private Button decButton; @@ -474,6 +474,13 @@ public abstract class FloatMeasurementView extends MeasurementView { } } + @Override + protected void setNameView(CharSequence text) { + super.setNameView(text); + + nameText = text.toString(); + } + @Override public void setExpand(boolean state) { final boolean show = state && isVisible() && evaluationResult != null; diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementView.java index 49375144..d61af4f8 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementView.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementView.java @@ -112,10 +112,19 @@ public abstract class MeasurementView extends TableLayout { unsorted.add(new LBMMeasurementView(context)); unsorted.add(new FatMeasurementView(context)); unsorted.add(new BoneMeasurementView(context)); + unsorted.add(new VisceralFatMeasurementView(context)); unsorted.add(new WaistMeasurementView(context)); unsorted.add(new WHtRMeasurementView(context)); unsorted.add(new HipMeasurementView(context)); unsorted.add(new WHRMeasurementView(context)); + unsorted.add(new ChestMeasurementView(context)); + unsorted.add(new ThighMeasurementView(context)); + unsorted.add(new BicepsMeasurementView(context)); + unsorted.add(new NeckMeasurementView(context)); + unsorted.add(new FatCaliperMeasurementView(context)); + unsorted.add(new Caliper1MeasurementView(context)); + unsorted.add(new Caliper2MeasurementView(context)); + unsorted.add(new Caliper3MeasurementView(context)); unsorted.add(new BMRMeasurementView(context)); unsorted.add(new CommentMeasurementView(context)); diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementViewSettings.java b/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementViewSettings.java index 98d94dda..b209f52b 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementViewSettings.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/MeasurementViewSettings.java @@ -52,10 +52,18 @@ public class MeasurementViewSettings { case WeightMeasurementView.KEY: // Weight can't be disabled return true; + case VisceralFatMeasurementView.KEY: case LBMMeasurementView.KEY: case BoneMeasurementView.KEY: case WaistMeasurementView.KEY: case HipMeasurementView.KEY: + case ChestMeasurementView.KEY: + case BicepsMeasurementView.KEY: + case ThighMeasurementView.KEY: + case NeckMeasurementView.KEY: + case Caliper1MeasurementView.KEY: + case Caliper2MeasurementView.KEY: + case Caliper3MeasurementView.KEY: defaultValue = false; break; default: @@ -76,6 +84,11 @@ public class MeasurementViewSettings { public boolean areDependenciesEnabled() { switch (key) { + case FatCaliperMeasurementView.KEY: + return isDependencyEnabled(Caliper1MeasurementView.KEY) + && isDependencyEnabled(Caliper2MeasurementView.KEY) + && isDependencyEnabled(Caliper3MeasurementView.KEY); + case BMIMeasurementView.KEY: case BMRMeasurementView.KEY: return isDependencyEnabled(WeightMeasurementView.KEY); diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/NeckMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/NeckMeasurementView.java new file mode 100644 index 00000000..e334995c --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/NeckMeasurementView.java @@ -0,0 +1,68 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class NeckMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "neck"; + + public NeckMeasurementView(Context context) { + super(context, R.string.label_neck, R.drawable.ic_neck); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getNeck(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setNeck(value); + } + + @Override + public String getUnit() { + return "cm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#00acc1"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/ThighMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/ThighMeasurementView.java new file mode 100644 index 00000000..b99189f5 --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/ThighMeasurementView.java @@ -0,0 +1,68 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class ThighMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "thigh"; + + public ThighMeasurementView(Context context) { + super(context, R.string.label_thigh, R.drawable.ic_thigh); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getThigh(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setThigh(value); + } + + @Override + public String getUnit() { + return "cm"; + } + + @Override + protected float getMaxValue() { + return 500; + } + + @Override + public int getColor() { + return Color.parseColor("#f4511e"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/VisceralFatMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/VisceralFatMeasurementView.java new file mode 100644 index 00000000..2c88e46c --- /dev/null +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/VisceralFatMeasurementView.java @@ -0,0 +1,77 @@ +/* Copyright (C) 2018 olie.xdev +* +* 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 +*/ +package com.health.openscale.gui.views; + +import android.content.Context; +import android.graphics.Color; + +import com.health.openscale.R; +import com.health.openscale.core.datatypes.ScaleMeasurement; +import com.health.openscale.core.evaluation.EvaluationResult; +import com.health.openscale.core.evaluation.EvaluationSheet; + +public class VisceralFatMeasurementView extends FloatMeasurementView { + // Don't change key value, it may be stored persistent in preferences + public static final String KEY = "visceralFat"; + + public VisceralFatMeasurementView(Context context) { + super(context, R.string.label_visceral_fat, R.drawable.ic_visceral_fat); + } + + @Override + public String getKey() { + return KEY; + } + + @Override + protected boolean supportsPercentageToAbsoluteWeightConversion() { + return true; + } + + @Override + protected float getMeasurementValue(ScaleMeasurement measurement) { + return measurement.getVisceralFat(); + } + + @Override + protected void setMeasurementValue(float value, ScaleMeasurement measurement) { + measurement.setVisceralFat(value); + } + + @Override + public String getUnit() { + if (shouldConvertPercentageToAbsoluteWeight()) { + return getScaleUser().getScaleUnit().toString(); + } + + return "%"; + } + + @Override + protected float getMaxValue() { + return maybeConvertPercentageToAbsoluteWeight(80); + } + + @Override + public int getColor() { + return Color.parseColor("#00bfa5"); + } + + @Override + protected EvaluationResult evaluateSheet(EvaluationSheet evalSheet, float value) { + return null; + } +} diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_biceps.png b/android_app/app/src/main/res/drawable-hdpi/ic_biceps.png new file mode 100644 index 00000000..a40b2a1a Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-hdpi/ic_caliper1.png new file mode 100644 index 00000000..475416db Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-hdpi/ic_caliper2.png new file mode 100644 index 00000000..bc88a5bd Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-hdpi/ic_caliper3.png new file mode 100644 index 00000000..b90d9107 Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_chest.png b/android_app/app/src/main/res/drawable-hdpi/ic_chest.png new file mode 100644 index 00000000..a9fb37b1 Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-hdpi/ic_fat_caliper.png new file mode 100644 index 00000000..bf247a63 Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_neck.png b/android_app/app/src/main/res/drawable-hdpi/ic_neck.png new file mode 100644 index 00000000..5ea610f1 Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_thigh.png b/android_app/app/src/main/res/drawable-hdpi/ic_thigh.png new file mode 100644 index 00000000..7be1029f Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-hdpi/ic_visceral_fat.png new file mode 100644 index 00000000..53727cdb Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_biceps.png b/android_app/app/src/main/res/drawable-ldpi/ic_biceps.png new file mode 100644 index 00000000..435546d8 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-ldpi/ic_caliper1.png new file mode 100644 index 00000000..e4ce43ee Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-ldpi/ic_caliper2.png new file mode 100644 index 00000000..ce7d22f5 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-ldpi/ic_caliper3.png new file mode 100644 index 00000000..b90be305 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_chest.png b/android_app/app/src/main/res/drawable-ldpi/ic_chest.png new file mode 100644 index 00000000..fb9e0dd3 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-ldpi/ic_fat_caliper.png new file mode 100644 index 00000000..b85bcac1 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_neck.png b/android_app/app/src/main/res/drawable-ldpi/ic_neck.png new file mode 100644 index 00000000..32371264 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_thigh.png b/android_app/app/src/main/res/drawable-ldpi/ic_thigh.png new file mode 100644 index 00000000..4b0d8cb2 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-ldpi/ic_visceral_fat.png new file mode 100644 index 00000000..767df8c2 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_biceps.png b/android_app/app/src/main/res/drawable-mdpi/ic_biceps.png new file mode 100644 index 00000000..9685d857 Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-mdpi/ic_caliper1.png new file mode 100644 index 00000000..b6662cf5 Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-mdpi/ic_caliper2.png new file mode 100644 index 00000000..e2a9b32e Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-mdpi/ic_caliper3.png new file mode 100644 index 00000000..f69a3681 Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_chest.png b/android_app/app/src/main/res/drawable-mdpi/ic_chest.png new file mode 100644 index 00000000..ec74ed2e Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-mdpi/ic_fat_caliper.png new file mode 100644 index 00000000..c63d10e1 Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_neck.png b/android_app/app/src/main/res/drawable-mdpi/ic_neck.png new file mode 100644 index 00000000..ea48ba7f Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_thigh.png b/android_app/app/src/main/res/drawable-mdpi/ic_thigh.png new file mode 100644 index 00000000..c819bf3e Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-mdpi/ic_visceral_fat.png new file mode 100644 index 00000000..c675fe8d Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_biceps.png b/android_app/app/src/main/res/drawable-xhdpi/ic_biceps.png new file mode 100644 index 00000000..d791e813 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper1.png new file mode 100644 index 00000000..536ade7a Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper2.png new file mode 100644 index 00000000..ec129615 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper3.png new file mode 100644 index 00000000..3d17d86e Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_chest.png b/android_app/app/src/main/res/drawable-xhdpi/ic_chest.png new file mode 100644 index 00000000..68467afb Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-xhdpi/ic_fat_caliper.png new file mode 100644 index 00000000..52ee878b Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_neck.png b/android_app/app/src/main/res/drawable-xhdpi/ic_neck.png new file mode 100644 index 00000000..799adbae Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_thigh.png b/android_app/app/src/main/res/drawable-xhdpi/ic_thigh.png new file mode 100644 index 00000000..54be7eaf Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-xhdpi/ic_visceral_fat.png new file mode 100644 index 00000000..204b525b Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_biceps.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_biceps.png new file mode 100644 index 00000000..c2e0db1d Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper1.png new file mode 100644 index 00000000..b206daf7 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper2.png new file mode 100644 index 00000000..bfa069e3 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper3.png new file mode 100644 index 00000000..2810e1d9 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_chest.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_chest.png new file mode 100644 index 00000000..9b1a0a3a Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_fat_caliper.png new file mode 100644 index 00000000..72ede516 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_neck.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_neck.png new file mode 100644 index 00000000..eb565bb3 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_thigh.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_thigh.png new file mode 100644 index 00000000..0a90a5c4 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_visceral_fat.png new file mode 100644 index 00000000..ce36fdb6 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_biceps.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_biceps.png new file mode 100644 index 00000000..6bc2eaed Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_biceps.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper1.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper1.png new file mode 100644 index 00000000..e896cb64 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper1.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper2.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper2.png new file mode 100644 index 00000000..2836d5b4 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper2.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper3.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper3.png new file mode 100644 index 00000000..13055cf8 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_caliper3.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_chest.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_chest.png new file mode 100644 index 00000000..912cb124 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_chest.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_fat_caliper.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_fat_caliper.png new file mode 100644 index 00000000..1b374811 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_fat_caliper.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_neck.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_neck.png new file mode 100644 index 00000000..50f128fa Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_neck.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_thigh.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_thigh.png new file mode 100644 index 00000000..448fb4c8 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_thigh.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_visceral_fat.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_visceral_fat.png new file mode 100644 index 00000000..b6f72e25 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_visceral_fat.png differ diff --git a/android_app/app/src/main/res/values/strings.xml b/android_app/app/src/main/res/values/strings.xml index 38fd5d82..5ee93625 100644 --- a/android_app/app/src/main/res/values/strings.xml +++ b/android_app/app/src/main/res/values/strings.xml @@ -223,4 +223,16 @@ Select measurement Select user Configure widget + Visceral fat + Chest circumference + Thigh circumference + Biceps circumference + Neck circumference + Body fat caliper + Chest skinfold + Abdominal skinfold + Thigh skinfold + Triceps skinfold + Abdominal skinfold + Hip skinfold