FileDocCategorySizeDatePackage
AccessibleDateAnimator.javaAPI DocAndroid 5.1 API1924Thu Mar 12 22:22:10 GMT 2015com.android.internal.widget

AccessibleDateAnimator

public class AccessibleDateAnimator extends android.widget.ViewAnimator
hide

Fields Summary
private long
mDateMillis
Constructors Summary
public AccessibleDateAnimator(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public booleandispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
Announce the currently-selected date when launched.

        if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
            // Clear the event's current text so that only the current date will be spoken.
            event.getText().clear();
            int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR |
                    DateUtils.FORMAT_SHOW_WEEKDAY;

            String dateString = DateUtils.formatDateTime(getContext(), mDateMillis, flags);
            event.getText().add(dateString);
            return true;
        }
        return super.dispatchPopulateAccessibilityEvent(event);
    
public voidsetDateMillis(long dateMillis)

        mDateMillis = dateMillis;