use of android.icu.text.SimpleDateFormat in project android_frameworks_base by ResurrectionRemix.
the class DatePickerCalendarDelegate method onLocaleChanged.
@Override
protected void onLocaleChanged(Locale locale) {
final TextView headerYear = mHeaderYear;
if (headerYear == null) {
// again later after everything has been set up.
return;
}
// Update the date formatter.
final String datePattern = DateFormat.getBestDateTimePattern(locale, "EMMMd");
mMonthDayFormat = new SimpleDateFormat(datePattern, locale);
mMonthDayFormat.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mYearFormat = new SimpleDateFormat("y", locale);
// Clear out the lazily-initialized accessibility event formatter.
mAccessibilityEventFormat = null;
// Update the header text.
onCurrentDateChanged(false);
}
use of android.icu.text.SimpleDateFormat in project android_frameworks_base by DirtyUnicorns.
the class SimpleMonthView method updateMonthYearLabel.
private void updateMonthYearLabel() {
final String format = DateFormat.getBestDateTimePattern(mLocale, MONTH_YEAR_FORMAT);
final SimpleDateFormat formatter = new SimpleDateFormat(format, mLocale);
formatter.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mMonthYearLabel = formatter.format(mCalendar.getTime());
}
use of android.icu.text.SimpleDateFormat in project android_frameworks_base by AOSPA.
the class DatePickerCalendarDelegate method onLocaleChanged.
@Override
protected void onLocaleChanged(Locale locale) {
final TextView headerYear = mHeaderYear;
if (headerYear == null) {
// again later after everything has been set up.
return;
}
// Update the date formatter.
final String datePattern = DateFormat.getBestDateTimePattern(locale, "EMMMd");
mMonthDayFormat = new SimpleDateFormat(datePattern, locale);
mMonthDayFormat.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mYearFormat = new SimpleDateFormat("y", locale);
// Clear out the lazily-initialized accessibility event formatter.
mAccessibilityEventFormat = null;
// Update the header text.
onCurrentDateChanged(false);
}
use of android.icu.text.SimpleDateFormat in project platform_frameworks_base by android.
the class DatePickerCalendarDelegate method onLocaleChanged.
@Override
protected void onLocaleChanged(Locale locale) {
final TextView headerYear = mHeaderYear;
if (headerYear == null) {
// again later after everything has been set up.
return;
}
// Update the date formatter.
final String datePattern = DateFormat.getBestDateTimePattern(locale, "EMMMd");
mMonthDayFormat = new SimpleDateFormat(datePattern, locale);
mMonthDayFormat.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
mYearFormat = new SimpleDateFormat("y", locale);
// Clear out the lazily-initialized accessibility event formatter.
mAccessibilityEventFormat = null;
// Update the header text.
onCurrentDateChanged(false);
}
use of android.icu.text.SimpleDateFormat in project platform_frameworks_base by android.
the class DatePickerCalendarDelegate method onPopulateAccessibilityEvent.
@Override
public void onPopulateAccessibilityEvent(AccessibilityEvent event) {
if (mAccessibilityEventFormat == null) {
final String pattern = DateFormat.getBestDateTimePattern(mCurrentLocale, "EMMMMdy");
mAccessibilityEventFormat = new SimpleDateFormat(pattern);
}
final CharSequence text = mAccessibilityEventFormat.format(mCurrentDate.getTime());
event.getText().add(text);
}
Aggregations