mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
[DatePicker] Fixed day of week adapter localization for APIs before O
Resolves https://github.com/material-components/material-components-android/issues/1948 PiperOrigin-RevId: 350474335
This commit is contained in:
parent
74350dead6
commit
bec2de92ac
@ -86,8 +86,9 @@ class DaysOfWeekAdapter extends BaseAdapter {
|
||||
(TextView) layoutInflater.inflate(R.layout.mtrl_calendar_day_of_week, parent, false);
|
||||
}
|
||||
calendar.set(Calendar.DAY_OF_WEEK, positionToDayOfWeek(position));
|
||||
Locale locale = dayOfWeek.getResources().getConfiguration().locale;
|
||||
dayOfWeek.setText(
|
||||
calendar.getDisplayName(Calendar.DAY_OF_WEEK, CALENDAR_DAY_STYLE, Locale.getDefault()));
|
||||
calendar.getDisplayName(Calendar.DAY_OF_WEEK, CALENDAR_DAY_STYLE, locale));
|
||||
dayOfWeek.setContentDescription(
|
||||
String.format(
|
||||
parent.getContext().getString(R.string.mtrl_picker_day_of_week_column_header),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user