Skip to content

Commit

Permalink
Releasing Glucosio 1.3.0 (#322)
Browse files Browse the repository at this point in the history
* Start working on Reminders.

* Updated build gradle to 2.2.0-rc1 from beta

* Add Reminders in Realm. Add migration to schema 4.

* Add ArrayAdapter for reminders.

* Continue work on Reminders.

* Add method to get all active reminders

* Automatic translation import (build 924).

* Continue work on Reminders.

* Fix migration.

* Add reminders notification.

* Fix some issues.

* Codacy warnings fixed

* Automatic translation import (build 937).

* Fix reminder triggered on boot, update Gradle version to stable.

* Update dependencies.

* Fix #285 (#295)

* Start working on Reminders.

* Add Reminders in Realm. Add migration to schema 4.

* Add ArrayAdapter for reminders.

* Continue work on Reminders.

* Add method to get all active reminders

* Fix notes export, abstract to a pseudo MVP architecture

* Continue work on Reminders.

* Simple note tests

* Fix notes export, abstract to a pseudo MVP architecture

* Simple note tests

* Improve quality from codacy report

* Fix migration.

* Class ReadingToCSV is not final, removed the redundant Sys.currentTMls, added todo to tests

* Add reminders notification.

* Improvements #2 on PR comments

* Fix some issues.

* Codacy warnings fixed

* Automatic translation import (build 937).

* Fix reminder triggered on boot, update Gradle version to stable.

* Update dependencies.

* Fix notes export, abstract to a pseudo MVP architecture

* Simple note tests

* Improve quality from codacy report

* Class ReadingToCSV is not final, removed the redundant Sys.currentTMls, added todo to tests

* Improvements #2 on PR comments

* Add labels on reminders.

* Add label on reminder notification.

* Updated deprecated comment from WebviewClient

* Moved URLs as fields

* Extracted some methods and leaved the code cleaner

* Created basic network connectivity

* Extracted external glucosio links to separate class

* Create and improved the basic network availability implementation

* Refactored the LicenseActivity:
- Made a presenter
- Some basic interaction tests

* Applied some format

* Renamed to ExternalLinkActivity

* Dialog made not cancelable

* Typo fix for preferences terms

* Initialized map with predefined 3 elements

* Created launcher methodˆ

* Replaced old call to Terms

* Replaced old call to Terms on HelloActivity

* Replaced all old called with the new launch method

* Created extractor method for extracting title and url from intent extra

* Removed obsolete tests and changed behaviour for presenter

* Added new strings. Fix label layout.

* Automatic translation import (build 957).

* - Added annotations for non null parameters
- Replaced empty string checks with Android classes
- Private method for extra extracting

* Fixed message for evening case

* Removed unnecessary local variable

* Allow comma as decimal separator when adding Glucose reading

* Added contributor credits

* Set locale back to default after tests in ReadingToolsTest

* Refactor AddReadingPresenter

* Cleaning some codacy useful warnings (#310)

* Removing unused variables and fields, inlining fields used once, minor improvements

* Removed unused misleading badge

* Remove categories creaition from assistant (fix #245) (#308)

* Removed unused functionality, introduced butterknife, removed categories mentioning and first tests for fragment

* Removed unused field and minor cleanup

* Removed cardview since it is not appropriate here

* Removed whitespace

* Added test for adapter

* Simplified adapter instantiation

* Added test for presenter

* Add mmol/L unit check in validGlucose method

* Remove hardcoded strings for concentrations like mg/dL

* Add number formatting for values when converting to string

* Improve FreeStyle Libre support (#306)

* Updated build gradle to 2.2.0-rc1 from beta

* Add labels on reminders.

* Add label on reminder notification.

* Updated deprecated comment from WebviewClient

* Moved URLs as fields

* Extracted some methods and leaved the code cleaner

* Created basic network connectivity

* Extracted external glucosio links to separate class

* Create and improved the basic network availability implementation

* Refactored the LicenseActivity:
- Made a presenter
- Some basic interaction tests

* Applied some format

* Renamed to ExternalLinkActivity

* Dialog made not cancelable

* Typo fix for preferences terms

* Initialized map with predefined 3 elements

* Created launcher methodˆ

* Replaced old call to Terms

* Replaced old call to Terms on HelloActivity

* Replaced all old called with the new launch method

* Created extractor method for extracting title and url from intent extra

* Removed obsolete tests and changed behaviour for presenter

* FreestyleLibre: divide raw value by 8.5

xdrip+/LimiTTer are dividing by 8.5, seems to work good for many people
there, including me

* FreesyleLibre: use latest value

We wanted to use the latest history value, but used the oldest one,
because array is filled from newest to oldest
Also we should use trend values instead of history values, as the
newest history value can be up to 15 minutes old

* Added new strings. Fix label layout.

* Automatic translation import (build 957).

* - Added annotations for non null parameters
- Replaced empty string checks with Android classes
- Private method for extra extracting

* Round the glucose value before converting to int

* Fixed message for evening case

* Removed unnecessary local variable

* Allow comma as decimal separator when adding Glucose reading

* Added contributor credits

* Set locale back to default after tests in ReadingToolsTest

* Refactor AddReadingPresenter

* Cleaning some codacy useful warnings (#310)

* Removing unused variables and fields, inlining fields used once, minor improvements

* Removed unused misleading badge

* Remove categories creaition from assistant (fix #245) (#308)

* Removed unused functionality, introduced butterknife, removed categories mentioning and first tests for fragment

* Removed unused field and minor cleanup

* Removed cardview since it is not appropriate here

* Removed whitespace

* Added test for adapter

* Simplified adapter instantiation

* Added test for presenter

* Fix mmol edit bug.

* Fix A1C conversion bug.

* Support 'Almost' translated languages

This application is used in various countries. And in Crowdin, some languages are already 100% translated or almost translated. But Glucosio is still support only English. These features are enhancement of it. And also, you can find Crowdin's API for translation status. But there are too many non-translated languages and it was useless to get it's all data. The API needs Auth key so until it is cleared, just maintaining available strings manually would be better. I already made code, but I will just keep it.

- Add available_languages.xml of 'almost' translated languages
- Add updateLocale code on MainPresenter when there is already user profile in DB
- Swap two codes order of calling MainPresenter for update MainActivities in start
- Add localeHelper variable for MainActivity
- Changed getLocalesWithTranslation to available languages
- Fixed bug in build.gradle. It should contain one more backslash

* Fix code duplication.

* Target API 25. Add App Shortcuts.

* Fix App Shortcuts.

* Releasing Glucosio  1.3.0

* Fixed for StringIndexOutOfBoundsException

* Trying to fix travis

* Releasing Glucosio  1.3.0 (38)
  • Loading branch information
paolorotolo authored Oct 28, 2016
1 parent 1ac224a commit 8a8ec7f
Show file tree
Hide file tree
Showing 110 changed files with 2,508 additions and 720 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jdk:
android:
components:
- tools
- build-tools-24.0.0
- android-24
- build-tools-25.0.0
- android-25
- extra-android-support
- extra-google-google_play_services
- extra-android-m2repository
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
[![Build Status](https://travis-ci.org/Glucosio/glucosio-android.svg)](https://travis-ci.org/Glucosio/glucosio-android)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a6f7bcc22a174ac9b36795438c143b6d)](https://www.codacy.com/app/Glucosio/glucosio-android?utm_source=github.com&utm_medium=referral&utm_content=Glucosio/glucosio-android&utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/Glucosio/glucosio-android/badge.svg?branch=develop)](https://coveralls.io/github/Glucosio/glucosio-android?branch=develop)
[![Stories in Ready](https://badge.waffle.io/Glucosio/glucosio-android.svg?label=ready&title=Ready)](http://waffle.io/Glucosio/glucosio-android)

# Glucosio for Android
Glucosio for Android, a user centered free and open source app for Diabetes management and research for Android.
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'jacoco'

android {
compileSdkVersion 24
compileSdkVersion 25
buildToolsVersion buildToolsVer

lintOptions {
Expand All @@ -33,9 +33,9 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 24
versionCode 35
versionName '1.2.1'
targetSdkVersion 25
versionCode 38
versionName '1.3.0'
applicationId 'org.glucosio.android'

vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -171,7 +171,7 @@ def getAllLocales() {

fileTree("src/main/res").visit { FileVisitDetails details ->
if (details.file.path.endsWith("strings.xml")) {
def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-', '').replaceAll('-r', '-')
def languageCode = details.file.parent.tokenize('/\\').last().replaceAll('values-', '').replaceAll('-r', '-')
languageCode = (languageCode == "values") ? "en" : languageCode;
foundLocales.append("\"").append(languageCode).append("\"").append(",")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ public void check_001_checkIfToolbarIsDisplayed() throws InterruptedException {
goThroughHelloActivity();
onView(withId(R.id.activity_main_toolbar)).check(matches(isDisplayed()));
}

// TODO: 09/09/16 Test the responses in UI -> Show ui notice when export started, is empty or error
}
25 changes: 22 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
<!-- Required for Google Cloud Messaging -->
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />

<!-- Required to set reminders -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<!-- Enable Chromebook support (no touch) -->
<uses-feature android:name="android.hardware.touchscreen"
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<permission
Expand Down Expand Up @@ -66,7 +70,7 @@
android:name=".activity.PreferencesActivity"
android:theme="@style/GlucosioSettings" />
<activity
android:name=".activity.LicenceActivity"
android:name=".activity.ExternalLinkActivity"
android:theme="@style/GlucosioSettings" />
<activity
android:name=".activity.AboutActivity"
Expand Down Expand Up @@ -154,6 +158,7 @@

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
Expand All @@ -169,7 +174,7 @@
android:value="org.glucosio.android.activity.MainActivity" />
</activity>

<!-- Google Cloud Messaging receiver -->
<!-- Google Cloud Messaging receiver -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
Expand All @@ -195,6 +200,15 @@
</intent-filter>
</service>

<receiver
android:name="org.glucosio.android.receivers.GlucosioBroadcastReceiver"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</receiver>

<!--
Register AnalyticsReceiver and AnalyticsService to support background
dispatching on non-Google Play devices
Expand Down Expand Up @@ -236,9 +250,14 @@
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity android:name=".activity.RemindersActivity"></activity>
</application>

</manifest>
12 changes: 11 additions & 1 deletion app/src/main/java/org/glucosio/android/GlucosioApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;

public class GlucosioApplication extends Application {

private static GlucosioApplication sInstance;

@Nullable
private Analytics analytics;

Expand All @@ -55,7 +58,7 @@ public class GlucosioApplication extends Application {
@Override
public void onCreate() {
super.onCreate();

sInstance = this;
initFont();
initLanguage();
}
Expand Down Expand Up @@ -153,6 +156,13 @@ public Preferences getPreferences() {
return preferences;
}

public static GlucosioApplication getInstance() {
if (sInstance == null) {
sInstance = new GlucosioApplication();
}
return sInstance;
}

@NonNull
public HelloPresenter createHelloPresenter(@NonNull final HelloActivity activity) {
return new HelloPresenter(activity, getDBHandler());
Expand Down
49 changes: 26 additions & 23 deletions app/src/main/java/org/glucosio/android/activity/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.widget.Toast;

import java.util.Locale;
import org.glucosio.android.GlucosioApplication;
import org.glucosio.android.R;
import org.glucosio.android.analytics.Analytics;

import java.util.Locale;

import org.glucosio.android.tools.network.GlucosioExternalLinks;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;

public class AboutActivity extends AppCompatActivity {
Expand Down Expand Up @@ -75,32 +73,28 @@ public void onCreate(final Bundle savedInstanceState) {
final Preference privacyPref = (Preference) findPreference("preference_privacy");
final Preference termsPref = (Preference) findPreference("preference_terms");
final Preference versionPref = (Preference) findPreference("preference_version");
final Preference thanksPref = (Preference) findPreference("preference_thanks");


termsPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(getActivity(), LicenceActivity.class);
Bundle bundle = new Bundle();
bundle.putString("key", "terms");
intent.putExtras(bundle);
startActivity(intent);

ExternalLinkActivity.launch(
getActivity(),
getString(R.string.preferences_terms),
GlucosioExternalLinks.TERMS);
addTermsAnalyticsEvent("Glucosio Terms opened");

return false;
}
});

licencesPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(getActivity(), LicenceActivity.class);
Bundle bundle = new Bundle();
bundle.putString("key", "open_source");
intent.putExtras(bundle);
startActivity(intent);

ExternalLinkActivity.launch(
getActivity(),
getString(R.string.preferences_licences_open),
GlucosioExternalLinks.LICENSES);
addTermsAnalyticsEvent("Glucosio Licence opened");
return false;
}
Expand Down Expand Up @@ -136,14 +130,23 @@ public boolean onPreferenceClick(Preference preference) {
privacyPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(getActivity(), LicenceActivity.class);
Bundle bundle = new Bundle();
bundle.putString("key", "privacy");
intent.putExtras(bundle);
startActivity(intent);

ExternalLinkActivity.launch(
getActivity(),
getString(R.string.preferences_privacy),
GlucosioExternalLinks.PRIVACY);
addTermsAnalyticsEvent("Glucosio Privacy opened");
return false;
}
});

thanksPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
ExternalLinkActivity.launch(
getActivity(),
getString(R.string.preferences_contributors),
GlucosioExternalLinks.THANKS);
addTermsAnalyticsEvent("Glucosio Contributors opened");
return false;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected void onCreate(Bundle savedInstanceState) {
this.createFANViewAndListener();

if (!"percentage".equals(presenter.getA1CUnitMeasuerement())) {
unitTextView.setText("mmol/mol");
unitTextView.setText(getString(R.string.mmol_mol));
}

// If an id is passed, open the activity in edit mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class AddGlucoseActivity extends AddReadingActivity {
private TextView readingTextView;
private EditText typeCustomEditText;
private EditText notesEditText;
private AppCompatButton addFreeStyleButton;
private TextInputLayout readingInputLayout;
private LabelledSpinner readingTypeSpinner;
private boolean isCustomType = false;

Expand All @@ -79,8 +77,8 @@ protected void onCreate(Bundle savedInstanceState) {
readingTypeSpinner.setItemsArray(R.array.dialog_add_measured_list);
readingTextView = (TextView) findViewById(R.id.glucose_add_concentration);
typeCustomEditText = (EditText) findViewById(R.id.glucose_type_custom);
readingInputLayout = (TextInputLayout) findViewById(R.id.glucose_add_concentration_layout);
addFreeStyleButton = (AppCompatButton) findViewById(R.id.glucose_add_freestyle_button);
TextInputLayout readingInputLayout = (TextInputLayout) findViewById(R.id.glucose_add_concentration_layout);
AppCompatButton addFreeStyleButton = (AppCompatButton) findViewById(R.id.glucose_add_freestyle_button);
notesEditText = (EditText) findViewById(R.id.glucose_add_notes);

this.createDateTimeViewAndListener();
Expand Down Expand Up @@ -110,9 +108,9 @@ public void onNothingChosen(View labelledSpinner, AdapterView<?> adapterView) {
TextView unitM = (TextView) findViewById(R.id.glucose_add_unit_measurement);

if (presenter.getUnitMeasuerement().equals("mg/dL")) {
unitM.setText("mg/dL");
unitM.setText(getString(R.string.mg_dL));
} else {
unitM.setText("mmol/L");
unitM.setText(getString(R.string.mmol_L));
}

// If an id is passed, open the activity in edit mode
Expand All @@ -121,7 +119,15 @@ public void onNothingChosen(View labelledSpinner, AdapterView<?> adapterView) {
if (this.isEditing()) {
setTitle(R.string.title_activity_add_glucose_edit);
GlucoseReading readingToEdit = presenter.getGlucoseReadingById(this.getEditId());
readingTextView.setText(readingToEdit.getReading() + "");

String readingString;
if (presenter.getUnitMeasuerement().equals("mg/dL")) {
readingString = String.valueOf(readingToEdit.getReading());
} else {
readingString = String.valueOf(presenter.convertToMmol(readingToEdit.getReading()));
}

readingTextView.setText(readingString);
notesEditText.setText(readingToEdit.getNotes());
cal.setTime(readingToEdit.getCreated());
this.getAddDateTextView().setText(dateTime.getDate(cal));
Expand Down Expand Up @@ -154,7 +160,7 @@ public void onNothingChosen(View labelledSpinner, AdapterView<?> adapterView) {

p = getIntent().getExtras();
reading = p.getString("reading");
if (reading!=null) {
if (reading != null) {
// If yes, first convert the decimal value from Freestyle to Integer
double d = Double.parseDouble(reading);
int glucoseValue = (int) d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
public class AddWeightActivity extends AddReadingActivity {

private TextView readingTextView;
private TextView unitTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -56,7 +55,7 @@ protected void onCreate(Bundle savedInstanceState) {
presenter.setReadingTimeNow();

readingTextView = (TextView) findViewById(R.id.weight_add_value);
unitTextView = (TextView) findViewById(R.id.weight_add_unit_measurement);
TextView unitTextView = (TextView) findViewById(R.id.weight_add_unit_measurement);

this.createDateTimeViewAndListener();
this.createFANViewAndListener();
Expand Down
Loading

0 comments on commit 8a8ec7f

Please sign in to comment.