1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 01:09:47 +01:00

Modify Charts Fragment's Titles

This commit is contained in:
vanous 2019-08-12 23:16:38 +02:00 committed by Andreas Shimokawa
parent 28fde846ea
commit 80bd31d894

View File

@ -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: