mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-27 18:20:21 +02:00
- add scroll views for small displays
- goal weight ist required - check if device has bluetooth before trying to access it
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.health.openscale"
|
||||
android:versionCode="4"
|
||||
android:versionCode="5"
|
||||
android:versionName="1.2" >
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
||||
|
@@ -54,6 +54,7 @@ public class OpenScale {
|
||||
context = con;
|
||||
scaleDB = new ScaleDatabase(context);
|
||||
scaleUserDB = new ScaleUserDatabase(context);
|
||||
btCom = null;
|
||||
|
||||
updateScaleData();
|
||||
}
|
||||
@@ -266,7 +267,7 @@ public class OpenScale {
|
||||
}
|
||||
|
||||
public boolean clearBtScaleData() {
|
||||
if (btCom != null)
|
||||
if (btCom == null)
|
||||
return false;
|
||||
|
||||
return btCom.sendBtData("9");
|
||||
@@ -303,6 +304,7 @@ public class OpenScale {
|
||||
btCom.findBT(btDeviceName);
|
||||
btCom.start();
|
||||
} catch (IOException e) {
|
||||
btCom = null;
|
||||
Log.e("OpenScale", "Error " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
@@ -157,6 +157,12 @@ public class UserSettingsActivity extends Activity {
|
||||
validate = false;
|
||||
}
|
||||
|
||||
if( txtGoalWeight.getText().toString().length() == 0 )
|
||||
{
|
||||
txtGoalWeight.setError(getResources().getString(R.string.error_goal_weight_required));
|
||||
validate = false;
|
||||
}
|
||||
|
||||
return validate;
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,17 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/scrollView2" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -173,7 +184,6 @@
|
||||
|
||||
</TableLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
@@ -194,6 +204,9 @@
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_ok" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
@@ -5,6 +5,17 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/scrollView3" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -281,6 +292,7 @@
|
||||
android:background="@drawable/flat_selector"
|
||||
android:text="@string/label_add" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -5,6 +5,17 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/scrollView4" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp" >
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -240,5 +251,11 @@
|
||||
android:text="@string/label_ok" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -92,4 +92,5 @@
|
||||
<string name="title_overview">Übersicht</string>
|
||||
<string name="title_users">Benutzer</string>
|
||||
<string name="label_add_user">Benutzer hinzufügen</string>
|
||||
<string name="error_goal_weight_required">Fehler Zielgewicht ist erforderlich!</string>
|
||||
</resources>
|
@@ -92,4 +92,5 @@
|
||||
<string name="info_enter_value_unit">あなたの値を入力してください</string>
|
||||
<string name="question_really_delete_all">あなたは本当にすべてのレコードを削除しますか</string>
|
||||
<string name="question_really_delete_user">あなたが本当にユーザーを削除しますか</string>
|
||||
<string name="error_goal_weight_required">目標体重が必要です</string>
|
||||
</resources>
|
@@ -68,6 +68,7 @@
|
||||
<string name="error_importing">Error importing</string>
|
||||
<string name="error_user_name_required">Error user name is required!</string>
|
||||
<string name="error_body_height_required">Error body height is required!</string>
|
||||
<string name="error_goal_weight_required">Error goal weight is required!</string>
|
||||
|
||||
<string name="info_data_deleted">Database entry deleted!</string>
|
||||
<string name="info_data_all_deleted">All database entries deleted!</string>
|
||||
|
Reference in New Issue
Block a user