Java Code Examples for com.wdullaer.materialdatetimepicker.Utils#tryAccessibilityAnnounce()

The following examples show how to use com.wdullaer.materialdatetimepicker.Utils#tryAccessibilityAnnounce() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimePickerDialog.java    From AssistantBySDK with Apache License 2.0 6 votes vote down vote up
private void updateAmPmDisplay(int amOrPm) {
    if (mVersion == Version.VERSION_2) {
        if (amOrPm == AM) {
            mAmTextView.setTextColor(mSelectedColor);
            mPmTextView.setTextColor(mUnselectedColor);
            Utils.tryAccessibilityAnnounce(mTimePicker, mAmText);
        } else {
            mAmTextView.setTextColor(mUnselectedColor);
            mPmTextView.setTextColor(mSelectedColor);
            Utils.tryAccessibilityAnnounce(mTimePicker, mPmText);
        }
    } else {
        if (amOrPm == AM) {
            mPmTextView.setText(mAmText);
            Utils.tryAccessibilityAnnounce(mTimePicker, mAmText);
            mPmTextView.setContentDescription(mAmText);
        } else if (amOrPm == PM){
            mPmTextView.setText(mPmText);
            Utils.tryAccessibilityAnnounce(mTimePicker, mPmText);
            mPmTextView.setContentDescription(mPmText);
        } else {
            mPmTextView.setText(mDoublePlaceholderText);
        }
    }
}
 
Example 2
Source File: TimePickerDialog.java    From AlarmOn with Apache License 2.0 6 votes vote down vote up
private void setHour(int value, boolean announce) {
    String format;
    if (mIs24HourMode) {
        format = "%02d";
    } else {
        format = "%d";
        value = value % 12;
        if (value == 0) {
            value = 12;
        }
    }

    CharSequence text = String.format(format, value);
    mHourView.setText(text);
    mHourSpaceView.setText(text);
    if (announce) {
        Utils.tryAccessibilityAnnounce(mTimePicker, text);
    }
}
 
Example 3
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 6 votes vote down vote up
private void setHour(int value, boolean announce) {
    String format;
    if (mIs24HourMode) {
        format = "%02d";
    } else {
        format = "%d";
        value = value % 12;
        if (value == 0) {
            value = 12;
        }
    }

    CharSequence text = String.format(mLocale, format, value);
    mHourView.setText(text);
    mHourSpaceView.setText(text);
    if (announce) {
        Utils.tryAccessibilityAnnounce(mTimePicker, text);
    }
}
 
Example 4
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 6 votes vote down vote up
private void updateAmPmDisplay(int amOrPm) {
    if (mVersion == Version.VERSION_2) {
        if (amOrPm == AM) {
            mAmTextView.setTextColor(mSelectedColor);
            mPmTextView.setTextColor(mUnselectedColor);
            Utils.tryAccessibilityAnnounce(mTimePicker, mAmText);
        } else {
            mAmTextView.setTextColor(mUnselectedColor);
            mPmTextView.setTextColor(mSelectedColor);
            Utils.tryAccessibilityAnnounce(mTimePicker, mPmText);
        }
    } else {
        if (amOrPm == AM) {
            mPmTextView.setText(mAmText);
            Utils.tryAccessibilityAnnounce(mTimePicker, mAmText);
            mPmTextView.setContentDescription(mAmText);
        } else if (amOrPm == PM){
            mPmTextView.setText(mPmText);
            Utils.tryAccessibilityAnnounce(mTimePicker, mPmText);
            mPmTextView.setContentDescription(mPmText);
        } else {
            mPmTextView.setText(mDoublePlaceholderText);
        }
    }
}
 
Example 5
Source File: TimePickerDialog.java    From Blackbulb with GNU General Public License v3.0 6 votes vote down vote up
private void setHour(int value, boolean announce) {
    String format;
    if (mIs24HourMode) {
        format = "%02d";
    } else {
        format = "%d";
        value = value % 12;
        if (value == 0) {
            value = 12;
        }
    }

    CharSequence text = String.format(format, value);
    mHourView.setText(text);
    mHourSpaceView.setText(text);
    if (announce) {
        Utils.tryAccessibilityAnnounce(mTimePicker, text);
    }
}
 
Example 6
Source File: TimePickerDialog.java    From AlarmOn with Apache License 2.0 5 votes vote down vote up
private void setSecond(int value) {
    if(value == 60) {
        value = 0;
    }
    CharSequence text = String.format(Locale.getDefault(), "%02d", value);
    Utils.tryAccessibilityAnnounce(mTimePicker, text);
    mSecondView.setText(text);
    mSecondSpaceView.setText(text);
}
 
Example 7
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 5 votes vote down vote up
private void setSecond(int value) {
    if(value == 60) {
        value = 0;
    }
    CharSequence text = String.format(mLocale, "%02d", value);
    Utils.tryAccessibilityAnnounce(mTimePicker, text);
    mSecondView.setText(text);
    mSecondSpaceView.setText(text);
}
 
Example 8
Source File: TimePickerDialog.java    From Blackbulb with GNU General Public License v3.0 5 votes vote down vote up
private boolean addKeyIfLegal(int keyCode) {
    // If we're in 24hour mode, we'll need to check if the input is full. If in AM/PM mode,
    // we'll need to see if AM/PM have been typed.
    int textSize = 6;
    if (mEnableMinutes && !mEnableSeconds) textSize = 4;
    if (!mEnableMinutes && !mEnableSeconds) textSize = 2;
    if ((mIs24HourMode && mTypedTimes.size() == textSize) ||
            (!mIs24HourMode && isTypedTimeFullyLegal())) {
        return false;
    }

    mTypedTimes.add(keyCode);
    if (!isTypedTimeLegalSoFar()) {
        deleteLastTypedKey();
        return false;
    }

    int val = getValFromKeyCode(keyCode);
    Utils.tryAccessibilityAnnounce(mTimePicker, String.format(Locale.getDefault(), "%d", val));
    // Automatically fill in 0's if AM or PM was legally entered.
    if (isTypedTimeFullyLegal()) {
        if (!mIs24HourMode && mTypedTimes.size() <= (textSize - 1)) {
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
        }
        mOkButton.setEnabled(true);
    }

    return true;
}
 
Example 9
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 5 votes vote down vote up
private boolean addKeyIfLegal(int keyCode) {
    // If we're in 24hour mode, we'll need to check if the input is full. If in AM/PM mode,
    // we'll need to see if AM/PM have been typed.
    int textSize = 6;
    if (mEnableMinutes && !mEnableSeconds) textSize = 4;
    if (!mEnableMinutes && !mEnableSeconds) textSize = 2;
    if ((mIs24HourMode && mTypedTimes.size() == textSize) ||
            (!mIs24HourMode && isTypedTimeFullyLegal())) {
        return false;
    }

    mTypedTimes.add(keyCode);
    if (!isTypedTimeLegalSoFar()) {
        deleteLastTypedKey();
        return false;
    }

    int val = getValFromKeyCode(keyCode);
    Utils.tryAccessibilityAnnounce(mTimePicker, String.format(mLocale, "%d", val));
    // Automatically fill in 0's if AM or PM was legally entered.
    if (isTypedTimeFullyLegal()) {
        if (!mIs24HourMode && mTypedTimes.size() <= (textSize - 1)) {
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
        }
        mOkButton.setEnabled(true);
    }

    return true;
}
 
Example 10
Source File: TimePickerDialog.java    From AlarmOn with Apache License 2.0 5 votes vote down vote up
private boolean addKeyIfLegal(int keyCode) {
    // If we're in 24hour mode, we'll need to check if the input is full. If in AM/PM mode,
    // we'll need to see if AM/PM have been typed.
    if ((mIs24HourMode && mTypedTimes.size() == (mEnableSeconds ? 6 : 4)) ||
            (!mIs24HourMode && isTypedTimeFullyLegal())) {
        return false;
    }

    mTypedTimes.add(keyCode);
    if (!isTypedTimeLegalSoFar()) {
        deleteLastTypedKey();
        return false;
    }

    int val = getValFromKeyCode(keyCode);
    Utils.tryAccessibilityAnnounce(mTimePicker, String.format("%d", val));
    // Automatically fill in 0's if AM or PM was legally entered.
    if (isTypedTimeFullyLegal()) {
        if (!mIs24HourMode && mTypedTimes.size() <= (mEnableSeconds ? 5 : 3)) {
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
        }
        mOkButton.setEnabled(true);
    }

    return true;
}
 
Example 11
Source File: TimePickerDialog.java    From Blackbulb with GNU General Public License v3.0 5 votes vote down vote up
private void setMinute(int value) {
    if (value == 60) {
        value = 0;
    }
    CharSequence text = String.format(Locale.getDefault(), "%02d", value);
    Utils.tryAccessibilityAnnounce(mTimePicker, text);
    mMinuteView.setText(text);
    mMinuteSpaceView.setText(text);
}
 
Example 12
Source File: DatePickerDialog.java    From AssistantBySDK with Apache License 2.0 5 votes vote down vote up
private void updateDisplay(boolean announce) {
    mYearView.setText(YEAR_FORMAT.format(mCalendar.getTime()));

    if (mVersion == Version.VERSION_1) {
        if (mDatePickerHeaderView != null) {
            if (mTitle != null)
                mDatePickerHeaderView.setText(mTitle.toUpperCase(Locale.getDefault()));
            else {
                mDatePickerHeaderView.setText(mCalendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG,
                        Locale.getDefault()).toUpperCase(Locale.getDefault()));
            }
        }
        mSelectedMonthTextView.setText(MONTH_FORMAT.format(mCalendar.getTime()));
        mSelectedDayTextView.setText(DAY_FORMAT.format(mCalendar.getTime()));
    }

    if (mVersion == Version.VERSION_2) {
        mSelectedDayTextView.setText(VERSION_2_FORMAT.format(mCalendar.getTime()));
        if (mTitle != null)
            mDatePickerHeaderView.setText(mTitle.toUpperCase(Locale.getDefault()));
        else
            mDatePickerHeaderView.setVisibility(View.GONE);
    }

    // Accessibility.
    long millis = mCalendar.getTimeInMillis();
    mAnimator.setDateMillis(millis);
    int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_YEAR;
    String monthAndDayText = DateUtils.formatDateTime(getActivity(), millis, flags);
    mMonthAndDayView.setContentDescription(monthAndDayText);

    if (announce) {
        flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR;
        String fullDateText = DateUtils.formatDateTime(getActivity(), millis, flags);
        Utils.tryAccessibilityAnnounce(mAnimator, fullDateText);
    }
}
 
Example 13
Source File: TimePickerDialog.java    From AssistantBySDK with Apache License 2.0 5 votes vote down vote up
private boolean addKeyIfLegal(int keyCode) {
    // If we're in 24hour mode, we'll need to check if the input is full. If in AM/PM mode,
    // we'll need to see if AM/PM have been typed.
    int textSize = 6;
    if (mEnableMinutes && !mEnableSeconds) textSize = 4;
    if (!mEnableMinutes && !mEnableSeconds) textSize = 2;
    if ((mIs24HourMode && mTypedTimes.size() == textSize) ||
            (!mIs24HourMode && isTypedTimeFullyLegal())) {
        return false;
    }

    mTypedTimes.add(keyCode);
    if (!isTypedTimeLegalSoFar()) {
        deleteLastTypedKey();
        return false;
    }

    int val = getValFromKeyCode(keyCode);
    Utils.tryAccessibilityAnnounce(mTimePicker, String.format(Locale.getDefault(), "%d", val));
    // Automatically fill in 0's if AM or PM was legally entered.
    if (isTypedTimeFullyLegal()) {
        if (!mIs24HourMode && mTypedTimes.size() <= (textSize - 1)) {
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
            mTypedTimes.add(mTypedTimes.size() - 1, KeyEvent.KEYCODE_0);
        }
        mOkButton.setEnabled(true);
    }

    return true;
}
 
Example 14
Source File: DatePickerDialog.java    From AlarmOn with Apache License 2.0 5 votes vote down vote up
private void updateDisplay(boolean announce) {
    if (mDayOfWeekView != null) {
        if(mTitle != null) mDayOfWeekView.setText(mTitle.toUpperCase(Locale.getDefault()));
        else {
            mDayOfWeekView.setText(mCalendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG,
                    Locale.getDefault()).toUpperCase(Locale.getDefault()));
        }
    }

    mSelectedMonthTextView.setText(mCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT,
            Locale.getDefault()).toUpperCase(Locale.getDefault()));
    mSelectedDayTextView.setText(DAY_FORMAT.format(mCalendar.getTime()));
    mYearView.setText(YEAR_FORMAT.format(mCalendar.getTime()));

    // Accessibility.
    long millis = mCalendar.getTimeInMillis();
    mAnimator.setDateMillis(millis);
    int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_YEAR;
    String monthAndDayText = DateUtils.formatDateTime(getActivity(), millis, flags);
    mMonthAndDayView.setContentDescription(monthAndDayText);

    if (announce) {
        flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR;
        String fullDateText = DateUtils.formatDateTime(getActivity(), millis, flags);
        Utils.tryAccessibilityAnnounce(mAnimator, fullDateText);
    }
}
 
Example 15
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 5 votes vote down vote up
private void setMinute(int value) {
    if (value == 60) {
        value = 0;
    }
    CharSequence text = String.format(mLocale, "%02d", value);
    Utils.tryAccessibilityAnnounce(mTimePicker, text);
    mMinuteView.setText(text);
    mMinuteSpaceView.setText(text);
}
 
Example 16
Source File: TimePickerDialog.java    From MaterialDateTimePicker with Apache License 2.0 4 votes vote down vote up
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate,
        boolean announce) {
    mTimePicker.setCurrentItemShowing(index, animateCircle);

    TextView labelToAnimate;
    switch(index) {
        case HOUR_INDEX:
            int hours = mTimePicker.getHours();
            if (!mIs24HourMode) {
                hours = hours % 12;
            }
            mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
            }
            labelToAnimate = mHourView;
            break;
        case MINUTE_INDEX:
            int minutes = mTimePicker.getMinutes();
            mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
            }
            labelToAnimate = mMinuteView;
            break;
        default:
            int seconds = mTimePicker.getSeconds();
            mTimePicker.setContentDescription(mSecondPickerDescription + ": " + seconds);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectSeconds);
            }
            labelToAnimate = mSecondView;
    }

    int hourColor = (index == HOUR_INDEX) ? mSelectedColor : mUnselectedColor;
    int minuteColor = (index == MINUTE_INDEX) ? mSelectedColor : mUnselectedColor;
    int secondColor = (index == SECOND_INDEX) ? mSelectedColor : mUnselectedColor;
    mHourView.setTextColor(hourColor);
    mMinuteView.setTextColor(minuteColor);
    mSecondView.setTextColor(secondColor);

    ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
    if (delayLabelAnimate) {
        pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
    }
    pulseAnimator.start();
}
 
Example 17
Source File: TimePickerDialog.java    From AssistantBySDK with Apache License 2.0 4 votes vote down vote up
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate,
        boolean announce) {
    mTimePicker.setCurrentItemShowing(index, animateCircle);

    TextView labelToAnimate;
    switch(index) {
        case HOUR_INDEX:
            int hours = mTimePicker.getHours();
            if (!mIs24HourMode) {
                hours = hours % 12;
            }
            mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
            }
            labelToAnimate = mHourView;
            break;
        case MINUTE_INDEX:
            int minutes = mTimePicker.getMinutes();
            mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
            }
            labelToAnimate = mMinuteView;
            break;
        default:
            int seconds = mTimePicker.getSeconds();
            mTimePicker.setContentDescription(mSecondPickerDescription + ": " + seconds);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectSeconds);
            }
            labelToAnimate = mSecondView;
    }

    int hourColor = (index == HOUR_INDEX) ? mSelectedColor : mUnselectedColor;
    int minuteColor = (index == MINUTE_INDEX) ? mSelectedColor : mUnselectedColor;
    int secondColor = (index == SECOND_INDEX) ? mSelectedColor : mUnselectedColor;
    mHourView.setTextColor(hourColor);
    mMinuteView.setTextColor(minuteColor);
    mSecondView.setTextColor(secondColor);

    ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
    if (delayLabelAnimate) {
        pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
    }
    pulseAnimator.start();
}
 
Example 18
Source File: TimePickerDialog.java    From AlarmOn with Apache License 2.0 4 votes vote down vote up
private void setCurrentItemShowing(int index, boolean animateCircle, boolean delayLabelAnimate,
        boolean announce) {
    mTimePicker.setCurrentItemShowing(index, animateCircle);

    TextView labelToAnimate;
    switch(index) {
        case HOUR_INDEX:
            int hours = mTimePicker.getHours();
            if (!mIs24HourMode) {
                hours = hours % 12;
            }
            mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours);
            }
            labelToAnimate = mHourView;
            break;
        case MINUTE_INDEX:
            int minutes = mTimePicker.getMinutes();
            mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
            }
            labelToAnimate = mMinuteView;
            break;
        default:
            int seconds = mTimePicker.getSeconds();
            mTimePicker.setContentDescription(mSecondPickerDescription + ": " + seconds);
            if (announce) {
                Utils.tryAccessibilityAnnounce(mTimePicker, mSelectSeconds);
            }
            labelToAnimate = mSecondView;
    }

    int hourColor = (index == HOUR_INDEX) ? mSelectedColor : mUnselectedColor;
    int minuteColor = (index == MINUTE_INDEX) ? mSelectedColor : mUnselectedColor;
    int secondColor = (index == SECOND_INDEX) ? mSelectedColor : mUnselectedColor;
    mHourView.setTextColor(hourColor);
    mMinuteView.setTextColor(minuteColor);
    mSecondView.setTextColor(secondColor);

    ObjectAnimator pulseAnimator = Utils.getPulseAnimator(labelToAnimate, 0.85f, 1.1f);
    if (delayLabelAnimate) {
        pulseAnimator.setStartDelay(PULSE_ANIMATOR_DELAY);
    }
    pulseAnimator.start();
}
 
Example 19
Source File: DayPickerView.java    From AlarmOn with Apache License 2.0 4 votes vote down vote up
/**
 * When scroll forward/backward events are received, announce the newly scrolled-to month.
 */
@SuppressLint("NewApi")
@Override
public boolean performAccessibilityAction(int action, Bundle arguments) {
    if (action != AccessibilityNodeInfo.ACTION_SCROLL_FORWARD &&
            action != AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) {
        return super.performAccessibilityAction(action, arguments);
    }

    // Figure out what month is showing.
    int firstVisiblePosition = getFirstVisiblePosition();
    int minMonth = mController.getStartDate().get(Calendar.MONTH);
    int month = (firstVisiblePosition + minMonth) % MonthAdapter.MONTHS_IN_YEAR;
    int year = (firstVisiblePosition + minMonth) / MonthAdapter.MONTHS_IN_YEAR + mController.getMinYear();
    MonthAdapter.CalendarDay day = new MonthAdapter.CalendarDay(year, month, 1);

    // Scroll either forward or backward one month.
    if (action == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD) {
        day.month++;
        if (day.month == 12) {
            day.month = 0;
            day.year++;
        }
    } else if (action == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) {
        View firstVisibleView = getChildAt(0);
        // If the view is fully visible, jump one month back. Otherwise, we'll just jump
        // to the first day of first visible month.
        if (firstVisibleView != null && firstVisibleView.getTop() >= -1) {
            // There's an off-by-one somewhere, so the top of the first visible item will
            // actually be -1 when it's at the exact top.
            day.month--;
            if (day.month == -1) {
                day.month = 11;
                day.year--;
            }
        }
    }

    // Go to that month.
    Utils.tryAccessibilityAnnounce(this, getMonthAndYearString(day));
    goTo(day, true, false, true);
    mPerformingScroll = true;
    return true;
}
 
Example 20
Source File: DatePickerDialog.java    From AlarmOn with Apache License 2.0 4 votes vote down vote up
private void setCurrentView(final int viewIndex) {
    long millis = mCalendar.getTimeInMillis();

    switch (viewIndex) {
        case MONTH_AND_DAY_VIEW:
            ObjectAnimator pulseAnimator = Utils.getPulseAnimator(mMonthAndDayView, 0.9f,
                    1.05f);
            if (mDelayAnimation) {
                pulseAnimator.setStartDelay(ANIMATION_DELAY);
                mDelayAnimation = false;
            }
            mDayPickerView.onDateChanged();
            if (mCurrentView != viewIndex) {
                mMonthAndDayView.setSelected(true);
                mYearView.setSelected(false);
                mAnimator.setDisplayedChild(MONTH_AND_DAY_VIEW);
                mCurrentView = viewIndex;
            }
            pulseAnimator.start();

            int flags = DateUtils.FORMAT_SHOW_DATE;
            String dayString = DateUtils.formatDateTime(getActivity(), millis, flags);
            mAnimator.setContentDescription(mDayPickerDescription+": "+dayString);
            Utils.tryAccessibilityAnnounce(mAnimator, mSelectDay);
            break;
        case YEAR_VIEW:
            pulseAnimator = Utils.getPulseAnimator(mYearView, 0.85f, 1.1f);
            if (mDelayAnimation) {
                pulseAnimator.setStartDelay(ANIMATION_DELAY);
                mDelayAnimation = false;
            }
            mYearPickerView.onDateChanged();
            if (mCurrentView != viewIndex) {
                mMonthAndDayView.setSelected(false);
                mYearView.setSelected(true);
                mAnimator.setDisplayedChild(YEAR_VIEW);
                mCurrentView = viewIndex;
            }
            pulseAnimator.start();

            CharSequence yearString = YEAR_FORMAT.format(millis);
            mAnimator.setContentDescription(mYearPickerDescription+": "+yearString);
            Utils.tryAccessibilityAnnounce(mAnimator, mSelectYear);
            break;
    }
}