From 53ccae347d9c3458f7785411502f272c85aaea6c Mon Sep 17 00:00:00 2001 From: a0z Date: Wed, 27 Nov 2024 20:48:19 +0100 Subject: [PATCH] Respiratory rate: remove unused string, fix disappearing tabs bug --- .../freeyourgadget/gadgetbridge/GBApplication.java | 8 ++++++-- .../activities/charts/ActivityChartsActivity.java | 2 +- .../activities/charts/RespiratoryRateDailyFragment.java | 8 ++++---- .../activities/charts/RespiratoryRateFragment.java | 2 +- .../activities/charts/RespiratoryRatePeriodFragment.java | 7 +------ app/src/main/res/values/arrays.xml | 2 +- app/src/main/res/values/strings.xml | 1 - 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index dbd91c454..d1c078984 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -1901,8 +1901,12 @@ public class GBApplication extends Application { } final String newPrefValue; - if (!StringUtils.isBlank(chartsTabsValue) && !chartsTabsValue.contains("respiratoryrate")) { - newPrefValue = chartsTabsValue + ",respiratoryrate"; + if (!StringUtils.isBlank(chartsTabsValue)) { + if (!chartsTabsValue.contains("respiratoryrate")) { + newPrefValue = chartsTabsValue + ",respiratoryrate"; + } else { + newPrefValue = chartsTabsValue; + } } else { newPrefValue = "respiratoryrate"; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ActivityChartsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ActivityChartsActivity.java index 85c9f899a..5a0dae6c4 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ActivityChartsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ActivityChartsActivity.java @@ -245,7 +245,7 @@ public class ActivityChartsActivity extends AbstractChartsActivity { case "calories": return getString(R.string.calories); case "respiratoryrate": - return getString(R.string.respiratoryRate); + return getString(R.string.respiratoryrate); } return String.format(Locale.getDefault(), "Unknown %d", position); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateDailyFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateDailyFragment.java index a6c53ba58..b14e1c7b8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateDailyFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateDailyFragment.java @@ -69,7 +69,7 @@ public class RespiratoryRateDailyFragment extends RespiratoryRateFragment legendEntries = new ArrayList<>(1); final LegendEntry respiratoryRateEntry = new LegendEntry(); - respiratoryRateEntry.label = getString(R.string.respiratoryRate); + respiratoryRateEntry.label = getString(R.string.respiratoryrate); respiratoryRateEntry.formColor = getResources().getColor(R.color.respiratory_rate_color); legendEntries.add(respiratoryRateEntry); respiratoryRateChart.getLegend().setTextColor(TEXT_COLOR); @@ -137,7 +137,7 @@ public class RespiratoryRateDailyFragment extends RespiratoryRateFragment values) { - final LineDataSet lineDataSet = new LineDataSet(values, getString(R.string.respiratoryRate)); + final LineDataSet lineDataSet = new LineDataSet(values, getString(R.string.respiratoryrate)); lineDataSet.setColor(getResources().getColor(R.color.respiratory_rate_color)); lineDataSet.setDrawCircles(false); lineDataSet.setLineWidth(2f); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateFragment.java index e4bddd87b..953a94d56 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRateFragment.java @@ -30,7 +30,7 @@ abstract class RespiratoryRateFragment extends AbstractCha @Override public String getTitle() { - return getString(R.string.respiratoryRate); + return getString(R.string.respiratoryrate); } @Override diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRatePeriodFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRatePeriodFragment.java index 7c70ed960..91c1fc56a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRatePeriodFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/RespiratoryRatePeriodFragment.java @@ -8,16 +8,11 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import com.github.mikephil.charting.charts.BarChart; import com.github.mikephil.charting.charts.Chart; import com.github.mikephil.charting.charts.LineChart; import com.github.mikephil.charting.components.LegendEntry; -import com.github.mikephil.charting.components.LimitLine; import com.github.mikephil.charting.components.XAxis; import com.github.mikephil.charting.components.YAxis; -import com.github.mikephil.charting.data.BarData; -import com.github.mikephil.charting.data.BarDataSet; -import com.github.mikephil.charting.data.BarEntry; import com.github.mikephil.charting.data.Entry; import com.github.mikephil.charting.data.LineData; import com.github.mikephil.charting.data.LineDataSet; @@ -119,7 +114,7 @@ public class RespiratoryRatePeriodFragment extends RespiratoryRateFragment@string/menuitem_temperature @string/menuitem_weight @string/watchface_widget_type_calories - @string/respiratoryRate + @string/respiratoryrate diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a106c48c3..fa84c2762 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2190,7 +2190,6 @@ Maximum Minimum Average - Respiratory Rate Steps Steps AVG Steps Total