From 293876ea3e5f83585e912d951c4d6c823034d848 Mon Sep 17 00:00:00 2001 From: Albin Warnicke Date: Fri, 17 May 2019 10:01:42 +0200 Subject: [PATCH] Added info about the icon that displays heart rate reliability. --- app/build.gradle | 4 ++-- .../com/chalmers/respiradar/MainActivity.java | 20 ++++++++++++++----- .../res/layout/dialog_main_information.xml | 20 ++++++++++++++++++- app/src/main/res/values/strings.xml | 4 ++++ 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 734299d..ef070b6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId 'com.chalmers.respiradar' minSdkVersion 23 targetSdkVersion 28 - versionCode 6 - versionName '1.3.0' + versionCode 8 + versionName '1.3.2' testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/chalmers/respiradar/MainActivity.java b/app/src/main/java/com/chalmers/respiradar/MainActivity.java index fa9cefc..54d31d9 100644 --- a/app/src/main/java/com/chalmers/respiradar/MainActivity.java +++ b/app/src/main/java/com/chalmers/respiradar/MainActivity.java @@ -683,35 +683,45 @@ public void onReceive(Context context, Intent intent) { } heartRateReliability = split[2]; switch (split[2]) { // determine the reliability of the measured heart rate - case "Outstanding": + case "ExceptionalHigh": + heartRateReliability = "Exceptional High"; heartButton.setImageResource(R.drawable.heart_blue); if (!heartButton.isEnabled()) { heartButton.setEnabled(true); heartButton.setVisibility(View.VISIBLE); } break; - case "Perfect": + case "VeryHigh": + heartRateReliability = "Very High"; heartButton.setImageResource(R.drawable.heart_green); if (!heartButton.isEnabled()) { heartButton.setEnabled(true); heartButton.setVisibility(View.VISIBLE); } break; - case "Good": + case "High": heartButton.setImageResource(R.drawable.heart_red); if (!heartButton.isEnabled()) { heartButton.setEnabled(true); heartButton.setVisibility(View.VISIBLE); } break; - case "Doubtful": + case "Medium": + heartButton.setImageResource(R.drawable.heart_red); + if (!heartButton.isEnabled()) { + heartButton.setEnabled(true); + heartButton.setVisibility(View.VISIBLE); + } + break; + case "Low": heartButton.setImageResource(R.drawable.heart_gray); if (!heartButton.isEnabled()) { heartButton.setEnabled(true); heartButton.setVisibility(View.VISIBLE); } break; - case "Bad": + case "VeryLow": + heartRateReliability = "Very Low"; heartButton.setImageResource(R.drawable.heart_dark_gray); if (!heartButton.isEnabled()) { heartButton.setEnabled(true); diff --git a/app/src/main/res/layout/dialog_main_information.xml b/app/src/main/res/layout/dialog_main_information.xml index 5fe6a2f..191681c 100644 --- a/app/src/main/res/layout/dialog_main_information.xml +++ b/app/src/main/res/layout/dialog_main_information.xml @@ -79,7 +79,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="0dp" - android:text="@string/info_main3" /> + android:text="@string/info_main3" + android:drawableEnd="@drawable/ic_bluetooth_black_24dp" + android:drawablePadding="8dp"/> + + + + + + A heart icon to the left of the displayed heart rate shows the reliability of the measured heart rate. + Tap on it to get more detailed information. + Rotate the phone to landscape to se a real time breathing amplitude graph, or just click Real Time Breathing in the options menu.