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

Commit d52ab97c authored by Isaac Katzenelson's avatar Isaac Katzenelson Committed by Android (Google) Code Review
Browse files

Merge "Update "home" label in widget on locale change" into ics-ub-clock-amazon

parents 85e48ec4 8b358270
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)) {