import java.util.TreeSet;
public class ZenModeAutomationSettings extends ZenModeSettingsBase {
- private static final SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("EEE");
static final Config CONFIG = getConditionProviderConfig();
+ // per-instance to ensure we're always using the current locale
+ private final SimpleDateFormat mDayFormat = new SimpleDateFormat("EEE");
private final Calendar mCalendar = Calendar.getInstance();
private ServiceListing mServiceListing;
private String dayString(int day) {
mCalendar.set(Calendar.DAY_OF_WEEK, day);
- return DAY_FORMAT.format(mCalendar.getTime());
+ return mDayFormat.format(mCalendar.getTime());
}
private static Config getConditionProviderConfig() {
Calendar.FRIDAY,
Calendar.SATURDAY,
};
- private static final SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("EEEE");
+ // per-instance to ensure we're always using the current locale
+ private final SimpleDateFormat mDayFormat = new SimpleDateFormat("EEEE");
private final SparseBooleanArray mDays = new SparseBooleanArray();
private final LinearLayout mLayout;
final CheckBox checkBox = (CheckBox) inflater.inflate(R.layout.zen_schedule_rule_day,
this, false);
c.set(Calendar.DAY_OF_WEEK, day);
- checkBox.setText(DAY_FORMAT.format(c.getTime()));
+ checkBox.setText(mDayFormat.format(c.getTime()));
checkBox.setChecked(mDays.get(day));
checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
private static final String KEY_START_TIME = "start_time";
private static final String KEY_END_TIME = "end_time";
- private static final SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("EEE");
-
public static final String ACTION = Settings.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS;
+ // per-instance to ensure we're always using the current locale
+ private final SimpleDateFormat mDayFormat = new SimpleDateFormat("EEE");
+
private Preference mDays;
private TimePickerPreference mStart;
private TimePickerPreference mEnd;
if (sb.length() > 0) {
sb.append(mContext.getString(R.string.summary_divider_text));
}
- sb.append(DAY_FORMAT.format(c.getTime()));
+ sb.append(mDayFormat.format(c.getTime()));
break;
}
}