mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-31 20:11:58 +02:00
- add buttons to delete single database entries
- add settings for disable/enable showing graph lines and graph notes - add icons in multiple sizes to support different screen densities - cleaned up imports
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
android:versionName="1.0" >
|
android:versionName="1.0" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="14"
|
android:minSdkVersion="16"
|
||||||
android:targetSdkVersion="21" />
|
android:targetSdkVersion="21" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
@@ -16,19 +16,16 @@
|
|||||||
|
|
||||||
package com.health.openscale.core;
|
package com.health.openscale.core;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothSocket;
|
import android.bluetooth.BluetoothSocket;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
|
||||||
import android.provider.SyncStateContract.Constants;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class BluetoothCommunication extends Thread {
|
public class BluetoothCommunication extends Thread {
|
||||||
public static final int BT_MESSAGE_READ = 0;
|
public static final int BT_MESSAGE_READ = 0;
|
||||||
public static final int BT_SOCKET_CLOSED = 1;
|
public static final int BT_SOCKET_CLOSED = 1;
|
||||||
|
@@ -80,6 +80,13 @@ public class OpenScale {
|
|||||||
scaleDBEntries = scaleDB.getAllDBEntries();
|
scaleDBEntries = scaleDB.getAllDBEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteScaleData(long id)
|
||||||
|
{
|
||||||
|
scaleDB.deleteEntry(id);
|
||||||
|
|
||||||
|
scaleDBEntries = scaleDB.getAllDBEntries();
|
||||||
|
}
|
||||||
|
|
||||||
public void importData(String filename) throws IOException {
|
public void importData(String filename) throws IOException {
|
||||||
File file = new File(filename);
|
File file = new File(filename);
|
||||||
|
|
||||||
@@ -187,7 +194,7 @@ public class OpenScale {
|
|||||||
case BluetoothCommunication.BT_SOCKET_CLOSED:
|
case BluetoothCommunication.BT_SOCKET_CLOSED:
|
||||||
scaleDBEntries = scaleDB.getAllDBEntries();
|
scaleDBEntries = scaleDB.getAllDBEntries();
|
||||||
|
|
||||||
Log.i("OpenScale", "Socket closed! Restarting socket ");
|
Log.d("OpenScale", "Socket closed! Restarting socket ");
|
||||||
|
|
||||||
startBluetoothServer(btDeviceName);
|
startBluetoothServer(btDeviceName);
|
||||||
break;
|
break;
|
||||||
@@ -248,7 +255,6 @@ public class OpenScale {
|
|||||||
scaleBtData.water = Float.parseFloat(csvField[8]);
|
scaleBtData.water = Float.parseFloat(csvField[8]);
|
||||||
scaleBtData.muscle = Float.parseFloat(csvField[9]);
|
scaleBtData.muscle = Float.parseFloat(csvField[9]);
|
||||||
|
|
||||||
Log.i("OpenScale", "MCU Data: " + scaleBtData);
|
|
||||||
scaleDB.insertEntry(scaleBtData);
|
scaleDB.insertEntry(scaleBtData);
|
||||||
} else {
|
} else {
|
||||||
Log.e("OpenScale", "Error calculated checksum (" + checksum + ") and received checksum (" + btChecksum + ") is different");
|
Log.e("OpenScale", "Error calculated checksum (" + checksum + ") and received checksum (" + btChecksum + ") is different");
|
||||||
|
@@ -18,8 +18,6 @@ package com.health.openscale.core;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
public class ScaleData {
|
public class ScaleData {
|
||||||
public long id;
|
public long id;
|
||||||
public Date date_time;
|
public Date date_time;
|
||||||
|
@@ -19,6 +19,7 @@ package com.health.openscale.core;
|
|||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
|
import android.database.SQLException;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteOpenHelper;
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -27,7 +28,6 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class ScaleDatabase extends SQLiteOpenHelper {
|
public class ScaleDatabase extends SQLiteOpenHelper {
|
||||||
@@ -78,10 +78,16 @@ public class ScaleDatabase extends SQLiteOpenHelper {
|
|||||||
db.delete(TABLE_NAME, null, null);
|
db.delete(TABLE_NAME, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertEntry(ScaleData scaleData) {
|
public boolean insertEntry(ScaleData scaleData) {
|
||||||
SQLiteDatabase db = getWritableDatabase();
|
SQLiteDatabase db = getWritableDatabase();
|
||||||
|
|
||||||
// Create a new map of values, where column names are the keys
|
Cursor cursorScaleDB = db.query(TABLE_NAME, new String[] {COLUMN_NAME_DATE_TIME}, COLUMN_NAME_DATE_TIME + " = ?",
|
||||||
|
new String[] {formatDateTime.format(scaleData.date_time)}, null, null, null);
|
||||||
|
|
||||||
|
if (cursorScaleDB.getCount() > 0) {
|
||||||
|
// we don't want double entries
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
values.put(COLUMN_NAME_DATE_TIME, formatDateTime.format(scaleData.date_time));
|
values.put(COLUMN_NAME_DATE_TIME, formatDateTime.format(scaleData.date_time));
|
||||||
values.put(COLUMN_NAME_WEIGHT, scaleData.weight);
|
values.put(COLUMN_NAME_WEIGHT, scaleData.weight);
|
||||||
@@ -89,12 +95,24 @@ public class ScaleDatabase extends SQLiteOpenHelper {
|
|||||||
values.put(COLUMN_NAME_WATER, scaleData.water);
|
values.put(COLUMN_NAME_WATER, scaleData.water);
|
||||||
values.put(COLUMN_NAME_MUSCLE, scaleData.muscle);
|
values.put(COLUMN_NAME_MUSCLE, scaleData.muscle);
|
||||||
|
|
||||||
// Insert the new row, returning the primary key value of the new row
|
try
|
||||||
long newRowId = db.insert(TABLE_NAME, null, values);
|
{
|
||||||
|
db.insertOrThrow(TABLE_NAME, null, values);
|
||||||
if (newRowId == -1) {
|
|
||||||
Log.e("ScaleDatabase", "An error occured while inserting a new entry into the scale database");
|
|
||||||
}
|
}
|
||||||
|
catch (SQLException e)
|
||||||
|
{
|
||||||
|
Log.e("ScaleDatabase", "An error occured while inserting a new entry into the scale database: " + e.toString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteEntry(long id) {
|
||||||
|
SQLiteDatabase db = getWritableDatabase();
|
||||||
|
|
||||||
|
db.delete(TABLE_NAME, COLUMN_NAME_ID + "= ?", new String[] {String.valueOf(id)});
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getCountsOfAllMonth(int year) {
|
public int[] getCountsOfAllMonth(int year) {
|
||||||
@@ -174,9 +192,7 @@ public class ScaleDatabase extends SQLiteOpenHelper {
|
|||||||
dataEntry.water = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_WATER));
|
dataEntry.water = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_WATER));
|
||||||
dataEntry.muscle = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_MUSCLE));
|
dataEntry.muscle = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_MUSCLE));
|
||||||
|
|
||||||
Date date = formatDateTime.parse(date_time);
|
dataEntry.date_time = formatDateTime.parse(date_time);
|
||||||
|
|
||||||
dataEntry.date_time = date;
|
|
||||||
|
|
||||||
scaleDBEntries.add(dataEntry);
|
scaleDBEntries.add(dataEntry);
|
||||||
|
|
||||||
@@ -230,9 +246,7 @@ public class ScaleDatabase extends SQLiteOpenHelper {
|
|||||||
dataEntry.water = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_WATER));
|
dataEntry.water = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_WATER));
|
||||||
dataEntry.muscle = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_MUSCLE));
|
dataEntry.muscle = cursorScaleDB.getFloat(cursorScaleDB.getColumnIndexOrThrow(COLUMN_NAME_MUSCLE));
|
||||||
|
|
||||||
Date date = formatDateTime.parse(date_time);
|
dataEntry.date_time = formatDateTime.parse(date_time);
|
||||||
|
|
||||||
dataEntry.date_time = date;
|
|
||||||
|
|
||||||
scaleDBEntries.add(dataEntry);
|
scaleDBEntries.add(dataEntry);
|
||||||
//Log.d("ScaleDatabase", dataEntry.toString());
|
//Log.d("ScaleDatabase", dataEntry.toString());
|
||||||
|
@@ -16,13 +16,16 @@
|
|||||||
|
|
||||||
package com.health.openscale.gui;
|
package com.health.openscale.gui;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
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.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
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;
|
||||||
@@ -54,11 +57,17 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
private LineChartView chartTop;
|
private LineChartView chartTop;
|
||||||
private ColumnChartView chartBottom;
|
private ColumnChartView chartBottom;
|
||||||
private TextView txtYear;
|
private TextView txtYear;
|
||||||
|
private SharedPreferences prefs;
|
||||||
|
|
||||||
private OpenScale openScale;
|
private OpenScale openScale;
|
||||||
|
|
||||||
private Calendar yearCal;
|
private Calendar yearCal;
|
||||||
|
|
||||||
|
private ArrayList<ScaleData> scaleDBEntries;
|
||||||
|
|
||||||
|
private enum lines {WEIGHT, FAT, WATER, MUSCLE}
|
||||||
|
private ArrayList<lines> activeLines;
|
||||||
|
|
||||||
public GraphFragment() {
|
public GraphFragment() {
|
||||||
yearCal = Calendar.getInstance();
|
yearCal = Calendar.getInstance();
|
||||||
}
|
}
|
||||||
@@ -71,6 +80,9 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
chartTop = (LineChartView) graphView.findViewById(R.id.chart_top);
|
chartTop = (LineChartView) graphView.findViewById(R.id.chart_top);
|
||||||
chartBottom = (ColumnChartView) graphView.findViewById(R.id.chart_bottom);
|
chartBottom = (ColumnChartView) graphView.findViewById(R.id.chart_bottom);
|
||||||
|
|
||||||
|
chartTop.setOnValueTouchListener(new ChartTopValueTouchListener());
|
||||||
|
chartBottom.setOnValueTouchListener(new ChartBottomValueTouchListener());
|
||||||
|
|
||||||
txtYear = (TextView) graphView.findViewById(R.id.txtYear);
|
txtYear = (TextView) graphView.findViewById(R.id.txtYear);
|
||||||
txtYear.setText(Integer.toString(yearCal.get(Calendar.YEAR)));
|
txtYear.setText(Integer.toString(yearCal.get(Calendar.YEAR)));
|
||||||
|
|
||||||
@@ -91,6 +103,8 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
});
|
});
|
||||||
openScale = OpenScale.getInstance(graphView.getContext());
|
openScale = OpenScale.getInstance(graphView.getContext());
|
||||||
|
|
||||||
|
prefs = PreferenceManager.getDefaultSharedPreferences(graphView.getContext());
|
||||||
|
|
||||||
return graphView;
|
return graphView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +116,7 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
private void generateLineData(Calendar cal)
|
private void generateLineData(Calendar cal)
|
||||||
{
|
{
|
||||||
ArrayList<ScaleData> scaleDBEntries = openScale.getAllDataOfMonth(yearCal.get(Calendar.YEAR), cal.get(Calendar.MONTH));
|
scaleDBEntries = openScale.getAllDataOfMonth(yearCal.get(Calendar.YEAR), cal.get(Calendar.MONTH));
|
||||||
|
|
||||||
SimpleDateFormat day_date = new SimpleDateFormat("dd", Locale.getDefault());
|
SimpleDateFormat day_date = new SimpleDateFormat("dd", Locale.getDefault());
|
||||||
|
|
||||||
@@ -131,38 +145,55 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
{
|
{
|
||||||
calDB.setTime(scaleEntry.date_time);
|
calDB.setTime(scaleEntry.date_time);
|
||||||
|
|
||||||
valuesWeight.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH), scaleEntry.weight));
|
valuesWeight.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH)-1, scaleEntry.weight));
|
||||||
valuesFat.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH), scaleEntry.fat));
|
valuesFat.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH)-1, scaleEntry.fat));
|
||||||
valuesWater.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH), scaleEntry.water));
|
valuesWater.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH)-1, scaleEntry.water));
|
||||||
valuesMuscle.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH), scaleEntry.muscle));
|
valuesMuscle.add(new PointValue(calDB.get(Calendar.DAY_OF_MONTH)-1, scaleEntry.muscle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Line lineWeight = new Line(valuesWeight).
|
Line lineWeight = new Line(valuesWeight).
|
||||||
setColor(Utils.COLOR_VIOLET).
|
setColor(Utils.COLOR_VIOLET).
|
||||||
setCubic(true).
|
setCubic(true).
|
||||||
setHasLabels(true).
|
setHasLabels(prefs.getBoolean("labelsEnable", true)).
|
||||||
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
||||||
Line lineFat = new Line(valuesFat).
|
Line lineFat = new Line(valuesFat).
|
||||||
setColor(Utils.COLOR_ORANGE).
|
setColor(Utils.COLOR_ORANGE).
|
||||||
setCubic(true).
|
setCubic(true).
|
||||||
setHasLabels(true).
|
setHasLabels(prefs.getBoolean("labelsEnable", true)).
|
||||||
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
||||||
Line lineWater = new Line(valuesWater).
|
Line lineWater = new Line(valuesWater).
|
||||||
setColor(Utils.COLOR_BLUE).
|
setColor(Utils.COLOR_BLUE).
|
||||||
setCubic(true).
|
setCubic(true).
|
||||||
setHasLabels(true).
|
setHasLabels(prefs.getBoolean("labelsEnable", true)).
|
||||||
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
||||||
Line lineMuscle = new Line(valuesMuscle).
|
Line lineMuscle = new Line(valuesMuscle).
|
||||||
setColor(Utils.COLOR_GREEN).
|
setColor(Utils.COLOR_GREEN).
|
||||||
setCubic(true).
|
setCubic(true).
|
||||||
setHasLabels(true).
|
setHasLabels(prefs.getBoolean("labelsEnable", true)).
|
||||||
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
setFormatter(new SimpleValueFormatter(1, false, null, null));
|
||||||
|
|
||||||
|
activeLines = new ArrayList<lines>();
|
||||||
|
|
||||||
|
if(prefs.getBoolean("weightEnable", true)) {
|
||||||
lines.add(lineWeight);
|
lines.add(lineWeight);
|
||||||
|
activeLines.add(GraphFragment.lines.WEIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(prefs.getBoolean("fatEnable", true)) {
|
||||||
lines.add(lineFat);
|
lines.add(lineFat);
|
||||||
|
activeLines.add(GraphFragment.lines.FAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(prefs.getBoolean("waterEnable", true)) {
|
||||||
lines.add(lineWater);
|
lines.add(lineWater);
|
||||||
|
activeLines.add(GraphFragment.lines.WATER);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(prefs.getBoolean("muscleEnable", true)) {
|
||||||
lines.add(lineMuscle);
|
lines.add(lineMuscle);
|
||||||
|
activeLines.add(GraphFragment.lines.MUSCLE);
|
||||||
|
}
|
||||||
|
|
||||||
LineChartData lineData = new LineChartData(lines);
|
LineChartData lineData = new LineChartData(lines);
|
||||||
lineData.setAxisXBottom(new Axis(axisValues).
|
lineData.setAxisXBottom(new Axis(axisValues).
|
||||||
@@ -219,12 +250,11 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
chartBottom.setColumnChartData(columnData);
|
chartBottom.setColumnChartData(columnData);
|
||||||
chartBottom.setValueSelectionEnabled(true);
|
chartBottom.setValueSelectionEnabled(true);
|
||||||
chartBottom.setZoomType(ZoomType.HORIZONTAL);
|
chartBottom.setZoomType(ZoomType.HORIZONTAL);
|
||||||
chartBottom.setOnValueTouchListener(new ValueTouchListener());
|
|
||||||
|
|
||||||
generateLineData(cal);
|
generateLineData(cal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ValueTouchListener implements ColumnChartView.ColumnChartOnValueTouchListener {
|
private class ChartBottomValueTouchListener implements ColumnChartView.ColumnChartOnValueTouchListener {
|
||||||
@Override
|
@Override
|
||||||
public void onValueTouched(int selectedLine, int selectedValue, ColumnValue value) {
|
public void onValueTouched(int selectedLine, int selectedValue, ColumnValue value) {
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
@@ -239,4 +269,34 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ChartTopValueTouchListener implements LineChartView.LineChartOnValueTouchListener {
|
||||||
|
@Override
|
||||||
|
public void onValueTouched(int lineIndex, int pointIndex, PointValue pointValue) {
|
||||||
|
ScaleData scaleEntry = scaleDBEntries.get(pointIndex);
|
||||||
|
lines selectedLine = activeLines.get(lineIndex);
|
||||||
|
|
||||||
|
String date_time = new SimpleDateFormat("dd. MMM yyyy (EE) HH:mm").format(scaleEntry.date_time);
|
||||||
|
|
||||||
|
switch (selectedLine) {
|
||||||
|
case WEIGHT:
|
||||||
|
Toast.makeText(getActivity(), getResources().getString(R.string.info_your_weight) + " " + scaleEntry.weight + getResources().getString(R.string.weight_unit) + " " + getResources().getString(R.string.info_on_date) + " " + date_time, Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case FAT:
|
||||||
|
Toast.makeText(getActivity(), getResources().getString(R.string.info_your_fat) + " " + scaleEntry.fat + "% " + getResources().getString(R.string.info_on_date) + " " + date_time, Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case WATER:
|
||||||
|
Toast.makeText(getActivity(), getResources().getString(R.string.info_your_water) + " " + scaleEntry.water + "% " + getResources().getString(R.string.info_on_date) + " " + date_time, Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case MUSCLE:
|
||||||
|
Toast.makeText(getActivity(), getResources().getString(R.string.info_your_muscle) + " " + scaleEntry.muscle + "% " + getResources().getString(R.string.info_on_date) + " " + date_time, Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingTouched() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,9 +16,6 @@
|
|||||||
|
|
||||||
package com.health.openscale.gui;
|
package com.health.openscale.gui;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -30,13 +27,14 @@ import android.support.v4.app.FragmentTransaction;
|
|||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.OpenScale;
|
import com.health.openscale.core.OpenScale;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
|
||||||
public class MainActivity extends ActionBarActivity implements
|
public class MainActivity extends ActionBarActivity implements
|
||||||
ActionBar.TabListener {
|
ActionBar.TabListener {
|
||||||
@@ -62,7 +60,7 @@ public class MainActivity extends ActionBarActivity implements
|
|||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
if(prefs.getBoolean("btEnable", true)) {
|
if(prefs.getBoolean("btEnable", false)) {
|
||||||
String deviceName = prefs.getString("btDeviceName", "openScale");
|
String deviceName = prefs.getString("btDeviceName", "openScale");
|
||||||
OpenScale.getInstance(getApplicationContext()).startBluetoothServer(deviceName);
|
OpenScale.getInstance(getApplicationContext()).startBluetoothServer(deviceName);
|
||||||
}
|
}
|
||||||
|
@@ -15,16 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package com.health.openscale.gui;
|
package com.health.openscale.gui;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.app.TimePickerDialog;
|
import android.app.TimePickerDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.DatePicker;
|
import android.widget.DatePicker;
|
||||||
@@ -34,6 +29,10 @@ import android.widget.TimePicker;
|
|||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.OpenScale;
|
import com.health.openscale.core.OpenScale;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class NewEntryActivity extends Activity {
|
public class NewEntryActivity extends Activity {
|
||||||
|
|
||||||
private EditText txtWeight;
|
private EditText txtWeight;
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.health.openscale.gui;
|
package com.health.openscale.gui;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -26,7 +25,6 @@ import android.preference.Preference;
|
|||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.health.openscale.R;
|
import com.health.openscale.R;
|
||||||
import com.health.openscale.core.OpenScale;
|
import com.health.openscale.core.OpenScale;
|
||||||
|
@@ -18,10 +18,12 @@ package com.health.openscale.gui;
|
|||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -56,23 +58,11 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
tableDataView = (TableLayout) tableView.findViewById(R.id.tableDataView);
|
tableDataView = (TableLayout) tableView.findViewById(R.id.tableDataView);
|
||||||
|
|
||||||
tableView.findViewById(R.id.btnImportData).setOnClickListener(new View.OnClickListener() {
|
tableView.findViewById(R.id.btnImportData).setOnClickListener(new onClickListenerImport());
|
||||||
public void onClick(View view) {
|
|
||||||
openImportDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
tableView.findViewById(R.id.btnExportData).setOnClickListener(new View.OnClickListener() {
|
tableView.findViewById(R.id.btnExportData).setOnClickListener(new onClickListenerExport());
|
||||||
public void onClick(View view) {
|
|
||||||
openExportDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
tableView.findViewById(R.id.btnDeleteAll).setOnClickListener(new View.OnClickListener() {
|
tableView.findViewById(R.id.btnDeleteAll).setOnClickListener(new onClickListenerDeleteAll());
|
||||||
public void onClick(View view) {
|
|
||||||
openDeleteAllDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE &&
|
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE &&
|
||||||
(getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_LARGE)
|
(getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_LARGE)
|
||||||
@@ -106,7 +96,12 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
for(ScaleData scaleEntry: scaleDBEntries)
|
for(ScaleData scaleEntry: scaleDBEntries)
|
||||||
{
|
{
|
||||||
TableRow dataRow = new TableRow(tableView.getContext());
|
TableRow dataRow = new TableRow(tableView.getContext());
|
||||||
dataRow.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
dataRow.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||||
|
|
||||||
|
TextView timeIdView = new TextView(tableView.getContext());
|
||||||
|
timeIdView.setText(Long.toString(scaleEntry.id));
|
||||||
|
timeIdView.setVisibility(View.GONE);
|
||||||
|
dataRow.addView(timeIdView);
|
||||||
|
|
||||||
TextView dateTextView = new TextView(tableView.getContext());
|
TextView dateTextView = new TextView(tableView.getContext());
|
||||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE ||
|
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE ||
|
||||||
@@ -143,6 +138,19 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
muscleView.setPadding(0, 5, 5, 5);
|
muscleView.setPadding(0, 5, 5, 5);
|
||||||
dataRow.addView(muscleView);
|
dataRow.addView(muscleView);
|
||||||
|
|
||||||
|
Button deleteButton = new Button(tableView.getContext());
|
||||||
|
deleteButton.setText("X");
|
||||||
|
deleteButton.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10);
|
||||||
|
deleteButton.setTextColor(Color.WHITE);
|
||||||
|
deleteButton.setBackground(getResources().getDrawable(R.drawable.flat_selector));
|
||||||
|
deleteButton.setGravity(Gravity.CENTER);
|
||||||
|
deleteButton.setPadding(0, 0, 0, 0);
|
||||||
|
deleteButton.setMinimumHeight(35);
|
||||||
|
deleteButton.setHeight(35);
|
||||||
|
deleteButton.setOnClickListener(new onClickListenerDelete());
|
||||||
|
dataRow.addView(deleteButton);
|
||||||
|
|
||||||
|
|
||||||
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE &&
|
if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE &&
|
||||||
(getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_LARGE)
|
(getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_LARGE)
|
||||||
{
|
{
|
||||||
@@ -154,12 +162,13 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
muscleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
|
muscleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
tableDataView.addView(dataRow, new TableLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
|
tableDataView.addView(dataRow, new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openImportDialog()
|
private class onClickListenerImport implements View.OnClickListener {
|
||||||
{
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
AlertDialog.Builder filenameDialog = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder filenameDialog = new AlertDialog.Builder(getActivity());
|
||||||
|
|
||||||
filenameDialog.setTitle(getResources().getString(R.string.info_set_filename) + " /sdcard ...");
|
filenameDialog.setTitle(getResources().getString(R.string.info_set_filename) + " /sdcard ...");
|
||||||
@@ -196,9 +205,11 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
filenameDialog.show();
|
filenameDialog.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void openExportDialog()
|
private class onClickListenerExport implements View.OnClickListener {
|
||||||
{
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
AlertDialog.Builder filenameDialog = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder filenameDialog = new AlertDialog.Builder(getActivity());
|
||||||
|
|
||||||
filenameDialog.setTitle(getResources().getString(R.string.info_set_filename) + " /sdcard ...");
|
filenameDialog.setTitle(getResources().getString(R.string.info_set_filename) + " /sdcard ...");
|
||||||
@@ -234,9 +245,11 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
filenameDialog.show();
|
filenameDialog.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void openDeleteAllDialog()
|
private class onClickListenerDeleteAll implements View.OnClickListener {
|
||||||
{
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder deleteAllDialog = new AlertDialog.Builder(getActivity());
|
||||||
|
|
||||||
deleteAllDialog.setMessage(getResources().getString(R.string.question_really_delete_all));
|
deleteAllDialog.setMessage(getResources().getString(R.string.question_really_delete_all));
|
||||||
@@ -245,7 +258,7 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
OpenScale.getInstance(tableView.getContext()).deleteAllDBEntries();
|
OpenScale.getInstance(tableView.getContext()).deleteAllDBEntries();
|
||||||
|
|
||||||
Toast.makeText(tableView.getContext(), getResources().getString(R.string.info_data_deleted), Toast.LENGTH_SHORT).show();
|
Toast.makeText(tableView.getContext(), getResources().getString(R.string.info_data_all_deleted), Toast.LENGTH_SHORT).show();
|
||||||
updateOnView(OpenScale.getInstance(tableView.getContext()).getScaleDBEntries());
|
updateOnView(OpenScale.getInstance(tableView.getContext()).getScaleDBEntries());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -258,4 +271,19 @@ public class TableFragment extends Fragment implements FragmentUpdateListener {
|
|||||||
|
|
||||||
deleteAllDialog.show();
|
deleteAllDialog.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class onClickListenerDelete implements View.OnClickListener {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
TableRow dataRow = (TableRow)v.getParent();
|
||||||
|
TextView idTextView = (TextView) dataRow.getChildAt(0);
|
||||||
|
long id = Long.parseLong(idTextView.getText().toString());
|
||||||
|
|
||||||
|
OpenScale.getInstance(tableView.getContext()).deleteScaleData(id);
|
||||||
|
|
||||||
|
Toast.makeText(tableView.getContext(), getResources().getString(R.string.info_data_deleted), Toast.LENGTH_SHORT).show();
|
||||||
|
updateOnView(OpenScale.getInstance(tableView.getContext()).getScaleDBEntries());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
android_app/app/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
BIN
android_app/app/src/main/res/drawable-hdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
android_app/app/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
BIN
android_app/app/src/main/res/drawable-mdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
android_app/app/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
BIN
android_app/app/src/main/res/drawable-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
BIN
android_app/app/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
BIN
android_app/app/src/main/res/drawable-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
BIN
android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
Normal file
BIN
android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
@@ -161,6 +161,18 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnCancel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="5"
|
||||||
|
android:background="@drawable/flat_selector"
|
||||||
|
android:text="@string/label_cancel" />
|
||||||
|
|
||||||
|
<Space
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="0.5" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnAdd"
|
android:id="@+id/btnAdd"
|
||||||
@@ -169,19 +181,6 @@
|
|||||||
android:layout_weight="5"
|
android:layout_weight="5"
|
||||||
android:background="@drawable/flat_selector"
|
android:background="@drawable/flat_selector"
|
||||||
android:text="@string/label_add" />
|
android:text="@string/label_add" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="0.5" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btnCancel"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="5"
|
|
||||||
android:background="@drawable/flat_selector"
|
|
||||||
android:text="@string/label_cancel" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -11,8 +11,6 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:id="@+id/linearLayout">
|
android:id="@+id/linearLayout">
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="25"
|
android:layout_weight="25"
|
||||||
android:text="@string/label_muscle"
|
android:text="@string/label_muscle_average"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
tools:context="com.health.openscale.MainActivity$PlaceholderFragment" >
|
tools:context="com.health.openscale.MainActivity$PlaceholderFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -17,14 +17,23 @@
|
|||||||
android:id="@+id/tableDataView"
|
android:id="@+id/tableDataView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:stretchColumns="*"
|
android:shrinkColumns="*"
|
||||||
android:shrinkColumns="*">
|
android:measureWithLargestChild="false"
|
||||||
|
android:stretchColumns="1,2,3,4,5,6">
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:id="@+id/tableHeader"
|
android:id="@+id/tableHeader"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" >
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/label_id"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:id="@+id/txtIdTableHeader"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -76,7 +85,9 @@
|
|||||||
android:minWidth="10dp"
|
android:minWidth="10dp"
|
||||||
android:text="@string/label_delete_all"
|
android:text="@string/label_delete_all"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="10sp" />
|
android:textSize="10sp"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp" />
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
@@ -4,6 +4,6 @@
|
|||||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
<dimen name="corner_radius">4dp</dimen>
|
<dimen name="corner_radius">4dp</dimen>
|
||||||
<dimen name="layer_padding">3dp</dimen>
|
<dimen name="layer_padding">2dp</dimen>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,10 +8,11 @@
|
|||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
<string name="label_add">Add</string>
|
<string name="label_add">Add</string>
|
||||||
<string name="label_cancel">Cancel</string>
|
<string name="label_cancel">Cancel</string>
|
||||||
<string name="label_ok">Ok</string>
|
<string name="label_ok">OK</string>
|
||||||
<string name="label_yes">Yes</string>
|
<string name="label_yes">Yes</string>
|
||||||
<string name="label_no">No</string>
|
<string name="label_no">No</string>
|
||||||
|
|
||||||
|
<string name="label_id">Id</string>
|
||||||
<string name="label_weight">Weight</string>
|
<string name="label_weight">Weight</string>
|
||||||
<string name="label_fat">Fat</string>
|
<string name="label_fat">Fat</string>
|
||||||
<string name="label_water">Water</string>
|
<string name="label_water">Water</string>
|
||||||
@@ -41,16 +42,30 @@
|
|||||||
<string name="error_exporting">Error exporting</string>
|
<string name="error_exporting">Error exporting</string>
|
||||||
<string name="error_importing">Error importing</string>
|
<string name="error_importing">Error importing</string>
|
||||||
|
|
||||||
<string name="info_data_deleted">All database entries deleted!</string>
|
<string name="info_data_deleted">Database entry deleted!</string>
|
||||||
|
<string name="info_data_all_deleted">All database entries deleted!</string>
|
||||||
<string name="info_data_exported">Data exported to</string>
|
<string name="info_data_exported">Data exported to</string>
|
||||||
<string name="info_data_imported">Data imported from</string>
|
<string name="info_data_imported">Data imported from</string>
|
||||||
<string name="info_set_filename">Set filename to</string>
|
<string name="info_set_filename">Set filename to</string>
|
||||||
<string name="info_enter_value_percent">Enter value in %</string>
|
<string name="info_enter_value_percent">Enter value in %</string>
|
||||||
<string name="info_enter_value_unit">Enter value in kg</string>
|
<string name="info_enter_value_unit">Enter value in kg</string>
|
||||||
|
<string name="info_new_bluetooth_data">New Bluetooth scale data received!</string>
|
||||||
|
|
||||||
<string name="question_really_delete_all">Do you really want to delete all database entries?</string>
|
<string name="question_really_delete_all">Do you really want to delete all database entries?</string>
|
||||||
|
|
||||||
<string name="label_bluetooth_title">Bluetooth</string>
|
<string name="label_bluetooth_title">Bluetooth</string>
|
||||||
<string name="label_bluetooth_enable">Enable Bluetooth Server</string>
|
<string name="label_bluetooth_enable">Enable Bluetooth Server</string>
|
||||||
<string name="label_device_name">Device Name</string>
|
<string name="label_device_name">Device Name</string>
|
||||||
|
|
||||||
|
<string name="label_enable_labels">Labels on data points</string>
|
||||||
|
<string name="label_enable_weight">Weight line</string>
|
||||||
|
<string name="label_enable_fat">Fat line</string>
|
||||||
|
<string name="label_enable_water">Water line</string>
|
||||||
|
<string name="label_enable_muscle">Muscle line</string>
|
||||||
|
|
||||||
|
<string name="info_your_weight">Your weight was</string>
|
||||||
|
<string name="info_your_fat">Your body fat was</string>
|
||||||
|
<string name="info_your_water">Your body water was</string>
|
||||||
|
<string name="info_your_muscle">Your body muscle was</string>
|
||||||
|
<string name="info_on_date">on</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -2,9 +2,16 @@
|
|||||||
<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_bluetooth_title">
|
<PreferenceCategory android:title="@string/label_bluetooth_title">
|
||||||
<CheckBoxPreference android:title="@string/label_bluetooth_enable" android:key="btEnable" android:defaultValue="true"/>
|
<CheckBoxPreference android:title="@string/label_bluetooth_enable" android:key="btEnable" android:defaultValue="false"/>
|
||||||
<EditTextPreference android:title="@string/label_device_name" android:key="btDeviceName" android:defaultValue="openScale" />
|
<EditTextPreference android:title="@string/label_device_name" android:key="btDeviceName" android:defaultValue="openScale" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="@string/title_graph">
|
||||||
|
<CheckBoxPreference android:title="@string/label_enable_labels" android:key="labelsEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_enable_weight" android:key="weightEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_enable_fat" android:key="fatEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_enable_water" android:key="waterEnable" android:defaultValue="true"/>
|
||||||
|
<CheckBoxPreference android:title="@string/label_enable_muscle" android:key="muscleEnable" android:defaultValue="true"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
Reference in New Issue
Block a user