diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ChartsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ChartsActivity.java index a85bced23..2f9a6c881 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ChartsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/ChartsActivity.java @@ -338,6 +338,24 @@ public class ChartsActivity extends AbstractGBFragmentActivity implements Charts return 5; } + private String getSleepTitle() { + if (GBApplication.getPrefs().getBoolean("charts_range", true)) { + return getString(R.string.weeksleepchart_sleep_a_month); + } + else{ + return getString(R.string.weeksleepchart_sleep_a_week); + } + } + + public String getStepsTitle() { + if (GBApplication.getPrefs().getBoolean("charts_range", true)) { + return getString(R.string.weekstepschart_steps_a_month); + } + else{ + return getString(R.string.weekstepschart_steps_a_week); + } + } + @Override public CharSequence getPageTitle(int position) { switch (position) { @@ -346,9 +364,9 @@ public class ChartsActivity extends AbstractGBFragmentActivity implements Charts case 1: return getString(R.string.sleepchart_your_sleep); case 2: - return getString(R.string.weeksleepchart_sleep_a_week); + return getSleepTitle(); case 3: - return getString(R.string.weekstepschart_steps_a_week); + return getStepsTitle(); case 4: return getString(R.string.stats_title); case 5: