Example usage for android.view.accessibility AccessibilityEvent setScrollable

List of usage examples for android.view.accessibility AccessibilityEvent setScrollable

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityEvent setScrollable.

Prototype

public void setScrollable(boolean scrollable) 

Source Link

Document

Sets if the source is scrollable.

Usage

From source file:com.actionbarsherlock.internal.widget.IcsAdapterView.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setScrollable(isScrollableForAccessibility());
    View selectedView = getSelectedView();
    if (selectedView != null) {
        event.setEnabled(selectedView.isEnabled());
    }//from   www .java 2 s.  c o  m
    event.setCurrentItemIndex(getSelectedItemPosition());
    event.setFromIndex(getFirstVisiblePosition());
    event.setToIndex(getLastVisiblePosition());
    event.setItemCount(getCount());
}

From source file:com.android.launcher2.PagedView.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setScrollable(true);
    if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED) {
        event.setFromIndex(mCurrentPage);
        event.setToIndex(mCurrentPage);/*from   ww  w. j  av  a  2  s.  co m*/
        event.setItemCount(getChildCount());
    }
}

From source file:cc.flydev.launcher.Page.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setScrollable(true);
}

From source file:com.android.internal.widget.ViewPager.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);

    event.setClassName(ViewPager.class.getName());
    event.setScrollable(canScroll());

    if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED && mAdapter != null) {
        event.setItemCount(mAdapter.getCount());
        event.setFromIndex(mCurItem);/* w  w w  .  j  ava2s .co m*/
        event.setToIndex(mCurItem);
    }
}