Skip to content

Commit

Permalink
Merge pull request #196 from Glucosio/develop
Browse files Browse the repository at this point in the history
Releasing 0.9.1
  • Loading branch information
paolorotolo committed Jan 7, 2016
2 parents 38f40f4 + 41b21d4 commit e7f5585
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 50 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 6
versionName '0.9.0'
versionCode 7
versionName '0.9.1'

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -73,6 +73,8 @@ dependencies {
transitive = true
}

wearApp project(':wear')

// Testing libraries
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test:runner:0.4.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.glucosio.android.R;
import org.glucosio.android.db.DatabaseHandler;
import org.glucosio.android.db.User;
import org.glucosio.android.tools.GlucoseConverter;
import org.glucosio.android.tools.InputFilterMinMax;

import java.util.ArrayList;
Expand Down Expand Up @@ -253,19 +252,6 @@ public boolean onPreferenceClick(Preference preference) {
return false;
}
});


convertMinMax();
}

private void convertMinMax() {
if(dB.getUser(1).getPreferred_unit().equals("mmol/L")) {
GlucoseConverter converter = new GlucoseConverter();
maxRangePref.setSummary(converter.toMmolL(Double.parseDouble(maxRangePref.getText())) +"");
minRangePref.setSummary(converter.toMmolL(Double.parseDouble(minRangePref.getText())) +"");
minEditText.setText(converter.toMmolL(Double.parseDouble(minRangePref.getText())) +"");
maxEditText.setText(converter.toMmolL(Double.parseDouble(maxRangePref.getText())) +"");
}
}

private void updateDB() {
Expand Down Expand Up @@ -300,8 +286,6 @@ private void updateDB() {
minRangePref.setEnabled(true);
maxRangePref.setEnabled(true);
}

convertMinMax();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,22 @@ private boolean validateType(String type){
}

private boolean validateReading(String reading) {
if (getUnitMeasuerement().equals("mg/dL")) {
// We store data in db in mg/dl
try {
Integer readingValue = Integer.parseInt(reading);
if (readingValue > 19 && readingValue < 601) {
//TODO: Add custom ranges
// TODO: Convert range in mmol/L
return true;
} else {
if (!reading.equals("")) {
if (getUnitMeasuerement().equals("mg/dL")) {
// We store data in db in mg/dl
try {
Integer readingValue = Integer.parseInt(reading);
if (readingValue > 19 && readingValue < 601) {
//TODO: Add custom ranges
// TODO: Convert range in mmol/L
return true;
} else {
return false;
}
} catch (Exception e) {
return false;
}
} catch (Exception e) {
return false;
}
} else {
} else {
/* try {
//TODO: Add custom ranges for mmol/L
Integer readingValue = Integer.parseInt(reading);
Expand All @@ -146,8 +147,11 @@ private boolean validateReading(String reading) {
} catch (Exception e) {
return false;
}*/
// TODO: return always true: we don't have ranges yet.
return true;
// IT return always true: we don't have ranges yet.
return true;
}
} else {
return false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_add_cholesterol.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />

<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
Expand All @@ -32,7 +32,7 @@
android:layout_alignParentRight="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/res/layout/activity_add_glucose.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />

<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:focusableInTouchMode="true">
<android.support.design.widget.FloatingActionButton
android:id="@+id/done_fab"
android:layout_width="wrap_content"
Expand All @@ -30,9 +31,10 @@
android:layout_margin="32dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:focusableInTouchMode="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -132,6 +134,7 @@
android:id="@+id/glucose_add_reading_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="false"
android:layout_marginTop="16dp"
custom:labelText="@string/dialog_add_measured"
custom:widgetColor="@color/glucosio_pink" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_add_hb1ac.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />

<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
Expand All @@ -32,7 +32,7 @@
android:layout_alignParentRight="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_add_ketone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />

<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
Expand All @@ -32,7 +32,7 @@
android:layout_alignParentRight="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_add_pressure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
app:contentInsetStart="0dp"
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />
<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
Expand All @@ -31,7 +31,7 @@
android:layout_alignParentRight="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_add_weight.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_marginBottom="16dp"
app:titleTextAppearance="@style/Toolbar.WhiteText" />

<ScrollView
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
Expand All @@ -32,7 +32,7 @@
android:layout_alignParentRight="true"
android:src="@drawable/ic_done_black_24dp"
app:backgroundTint="@color/glucosio_accent" />
</ScrollView>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</string-array>
<string name="tip_example" translatable="false">Use less cheese in your recipes and meals. Fresh mozzarella packed in water and Swiss cheese are usually lower in sodium.</string>
<string name="preferences_about">About</string>
<string name="version" translatable="false">0.9.0 (Imli)</string>
<string name="version" translatable="false">0.9.1 (Imli)</string>
<string name="preferences_version">Version</string>
<string name="preferences_terms">Terms of use</string>
<string name="glucose_reading_type">Type</string>
Expand Down
4 changes: 2 additions & 2 deletions wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.glucosio.android"
minSdkVersion 21
targetSdkVersion 23
versionCode 6
versionName "0.9.0"
versionCode 7
versionName "0.9.1"
}
buildTypes {
debug {
Expand Down
2 changes: 1 addition & 1 deletion wear/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Add Glucose reading</string>
<string name="app_name">Glucosio</string>
<string name="dialog_add_type_1">Before breakfast</string>
<string name="dialog_add_type_2">After breakfast</string>
<string name="dialog_add_type_3">Before lunch</string>
Expand Down

0 comments on commit e7f5585

Please sign in to comment.