Example usage for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_VIEW_SCROLLED

List of usage examples for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_VIEW_SCROLLED

Introduction

In this page you can find the example usage for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_VIEW_SCROLLED.

Prototype

int TYPE_VIEW_SCROLLED

To view the source code for android.support.v4.view.accessibility AccessibilityEventCompat TYPE_VIEW_SCROLLED.

Click Source Link

Document

Represents the event of scrolling a view.

Usage

From source file:com.android.screenspeak.eventprocessor.ProcessorScrollPosition.java

private boolean shouldIgnoreEvent(AccessibilityEvent event) {
    switch (event.getEventType()) {
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED:
        return true;
    case AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED:
    case AccessibilityEventCompat.TYPE_VIEW_SCROLLED:
        return shouldIgnoreUpdateListEvent(event);
    default://from w  w  w .j a va2s .co  m
        return false;
    }
}

From source file:com.google.android.marvin.mytalkback.ProcessorScrollPosition.java

private boolean shouldIgnoreEvent(AccessibilityEvent event) {
    switch (event.getEventType()) {
    case AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUSED:
    case AccessibilityEventCompat.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED:
        return true;
    case AccessibilityEventCompat.TYPE_VIEW_SCROLLED:
        return shouldIgnoreScrollEvent(event);
    default://from  w  w  w  . j av  a 2 s .c o  m
        return false;
    }
}

From source file:com.redinput.datetimepickercompat.date.YearPickerView.java

private void installAccessibilityDelegate() {
    // The accessibility delegate enables customizing accessibility behavior
    // via composition as opposed as inheritance. The main benefit is that
    // one can write a backwards compatible application by setting the delegate
    // only if the API level is high enough i.e. the delegate is part of the APIs.
    // The easiest way to achieve that is by using the support library which
    // takes the burden of checking API version and knowing which API version
    // introduced the delegate off the developer.
    ViewCompat.setAccessibilityDelegate(this, new AccessibilityDelegateCompat() {

        @Override/*  w ww .j  a va 2  s  .c om*/
        public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
            super.onInitializeAccessibilityEvent(host, event);
            // Note that View.onInitializeAccessibilityNodeInfo was introduced in
            // ICS and we would like to tweak a bit the text that is reported to
            // accessibility services via the AccessibilityNodeInfo.
            if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
                event.setFromIndex(0);
            }
        }

    });
}

From source file:VerticalViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this VerticalViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }//from  w  w  w .  jav  a 2 s.  c  om

    // 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:com.cmtv.tv.widget.BaseViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this BaseViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }//from w  w  w.  j a  va 2s.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;
}

From source file:com.isapp.android.circularviewpager.CircularViewPager.java

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    // Dispatch scroll events from this ViewPager.
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
        return super.dispatchPopulateAccessibilityEvent(event);
    }//  w ww.  j  a  v a 2 s  .  c o m
    // 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:example.luojing.androidsourceanalysis.ViewPager.java

/**
 * ???/*  w ww  .  ja va  2  s.com*/
 */
@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: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 w ww.  j  a  va2s.  c  om

    // 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: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);
    }//ww  w  .  j  a v a2 s . c om

    // 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;
}