From: Gustavo Martin Morcuende Date: Sun, 16 Nov 2014 16:01:15 +0000 (+0100) Subject: WeatherInformation: tabs text as string resource X-Git-Tag: weatherinformation-1.0~56 X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=7bb8066b2e784cb856000ca7aa16af3f580a37e9;p=AndroidWeatherInformation WeatherInformation: tabs text as string resource --- diff --git a/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java b/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java index 11a3c5f..afe06c5 100644 --- a/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java +++ b/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java @@ -117,7 +117,7 @@ public class MainTabsActivity extends FragmentActivity { if (itemId == R.id.weather_menu_settings) { intent = new Intent("name.gumartinm.weather.information.WEATHERINFO") .setComponent(new ComponentName("name.gumartinm.weather.information", - "name.gumartinm.weather.information.activity.WeatherInformationPreferencesActivity")); + "name.gumartinm.weather.information.activity.PreferencesActivity")); this.startActivity(intent); return true; } else if (itemId == R.id.weather_menu_map) { @@ -167,16 +167,16 @@ public class MainTabsActivity extends FragmentActivity { // 2. Update forecast tab text. final SharedPreferences sharedPreferences = PreferenceManager - .getDefaultSharedPreferences(this); + .getDefaultSharedPreferences(this.getApplicationContext()); final String keyPreference = this.getString(R.string.weather_preferences_day_forecast_key); final String value = sharedPreferences.getString(keyPreference, ""); String humanValue = ""; if (value.equals("5")) { - humanValue = "5 DAY FORECAST"; + humanValue = this.getString(R.string.text_tab_five_days_forecast); } else if (value.equals("10")) { - humanValue = "10 DAY FORECAST"; + humanValue = this.getString(R.string.text_tab_ten_days_forecast); } else if (value.equals("14")) { - humanValue = "14 DAY FORECAST"; + humanValue = this.getString(R.string.text_tab_fourteen_days_forecast); } actionBar.getTabAt(1).setText(humanValue); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b9893b8..75e2b5d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,7 +19,10 @@ Weather Information Icon weather - + + 5 DAY FORECAST + 10 DAY FORECAST + 14 DAY FORECAST SUN RISE SUN SET FEELS LIKE