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

Commit 44fb4bf8 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Update "home" label in widget on locale change

Bug: 8445703
Change-Id: Ibfb3516006e6446c5e2994af111e47b95578ebe4
parent ee43e97c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ public class DigitalWidgetViewsFactory extends BroadcastReceiver implements Remo
        }
        if (mReloadCitiesDb) {
            mAdapter.loadCitiesDb(mContext);
            mAdapter.updateHomeLabel(mContext);
            mReloadCitiesDb = false;
        }

+8 −0
Original line number Diff line number Diff line
@@ -105,6 +105,14 @@ public class WorldClockAdapter extends BaseAdapter {
        }
    }

    public void updateHomeLabel(Context context) {
        // Update the "home" label if the home time zone clock is shown
        if (needHomeCity() && mCitiesList.length > 0) {
            ((CityObj) mCitiesList[0]).mCityName =
                    context.getResources().getString(R.string.home_label);
        }
    }

    public boolean needHomeCity() {
        SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mContext);
        if (sharedPref.getBoolean(SettingsActivity.KEY_AUTO_HOME_CLOCK, false)) {