Example usage for android.view View dispatchPopulateAccessibilityEvent

List of usage examples for android.view View dispatchPopulateAccessibilityEvent

Introduction

In this page you can find the example usage for android.view View dispatchPopulateAccessibilityEvent.

Prototype

public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) 

Source Link

Document

Dispatches an AccessibilityEvent to the View first and then to its children for adding their text content to the event.

Usage

From source file:com.suning.boxcontroller.control.ExViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // ViewPagers should only report accessibility info for the current page,
    // otherwise things get very confusing.

    // to-do: Should this note something about the paging container?

    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (child.getVisibility() == VISIBLE) {
            final ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }/*from  ww w. j  a v  a2 s. co  m*/
        }
    }

    return false;
}

From source file:com.av.remusic.widget.RoundViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this ViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }/*from   ww  w .j  av  a  2s .  c o m*/

    // Dispatch all other accessibility events from the currentPosition page.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (child.getVisibility() == VISIBLE) {
            final ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }
        }
    }

    return false;
}

From source file:example.luojing.androidsourceanalysis.ViewPager.java

/**
 * ???//from   w w  w. ja  v a 2 s .  co m
 */
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this ViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }

    // Dispatch all other accessibility events from the current page.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (child.getVisibility() == VISIBLE) {
            final ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }
        }
    }

    return false;
}

From source file:android.improving.utils.views.cardsview.OrientedViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this ViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }/*from   ww  w. j a v a 2  s .com*/

    // Dispatch all other accessibility events from the current page.
    final int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = getChildAt(i);
        if (child.getVisibility() == VISIBLE) {
            final ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }
        }
    }

    return false;
}