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

Commit 1782b8e7 authored by Alan Viverette's avatar Alan Viverette Committed by android-build-merger
Browse files

Merge "Use standalone capitalization for month labels" into nyc-dev am: 89524117 am: cee6b62c

am: a9c50001

* commit 'a9c50001':
  Use standalone capitalization for month labels

Change-Id: I34b06d007ffb330576278865cf7935e2f3f9cab6
parents aff5daf5 a9c50001
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.icu.text.DisplayContext;
import android.icu.text.SimpleDateFormat;
import android.os.Parcelable;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
@@ -38,7 +40,6 @@ import android.view.accessibility.AccessibilityEvent;
import android.widget.DayPickerView.OnDaySelectedListener;
import android.widget.YearPickerView.OnYearSelectedListener;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

@@ -303,6 +304,7 @@ class DatePickerCalendarDelegate extends DatePicker.AbstractDatePickerDelegate {
        // 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);

        // Update the header text.
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.icu.text.DisplayContext;
import android.icu.text.SimpleDateFormat;
import android.os.Bundle;
import android.text.TextPaint;
@@ -184,6 +185,7 @@ class SimpleMonthView extends View {
    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());
    }