Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64790854 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Merge branch '5518-s-fallback-city' into 'release-1.7-rc'

Fallback to the forecast cached city

See merge request !142
parents 7a9da1f0 c2c38505
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -242,8 +242,8 @@ public class Preferences {
        editor.apply();
    }

    public static String getCachedCity(Context context) {
        return getPrefs(context).getString(Constants.CACHED_CITY, "Unknown");
    public static String getCachedCity(Context context, String fallbackCity) {
        return getPrefs(context).getString(Constants.CACHED_CITY, fallbackCity);
    }

    public static long lastWeatherUpdateTimestamp(Context context) {
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class ForecastBuilder {

        // City
        TextView textCity = weatherPanel.findViewById(R.id.weather_city);
        textCity.setText(Preferences.getCachedCity(context));
        textCity.setText(Preferences.getCachedCity(context, w.getCity()));

        // Weather Condition
        TextView weatherCondition = weatherPanel.findViewById(R.id.weather_condition);