当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityEventCompat.TYPE_VIEW_SCROLLED属性代码示例

本文整理汇总了Java中android.support.v4.view.accessibility.AccessibilityEventCompat.TYPE_VIEW_SCROLLED属性的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityEventCompat.TYPE_VIEW_SCROLLED属性的具体用法?Java AccessibilityEventCompat.TYPE_VIEW_SCROLLED怎么用?Java AccessibilityEventCompat.TYPE_VIEW_SCROLLED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v4.view.accessibility.AccessibilityEventCompat的用法示例。


在下文中一共展示了AccessibilityEventCompat.TYPE_VIEW_SCROLLED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispatchPopulateAccessibilityEvent

@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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:DirectionalViewpager.java

示例2: dispatchPopulateAccessibilityEvent

@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 YViewPager.ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem
                    && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:22,代码来源:YViewPager.java

示例3: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(DirectionalViewpager.class.getName());
    AccessibilityRecordCompat recordCompat = null;
    if (isHorizontal()) {
        recordCompat =
                AccessibilityEventCompat.asRecord(event);
    } else {
        recordCompat = AccessibilityRecordCompat.obtain();
    }
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:ynztlxdeai,项目名称:TextReader,代码行数:19,代码来源:DirectionalViewpager.java

示例4: dispatchPopulateAccessibilityEvent

@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 YViewPagerOrigin.ItemInfo ii = infoForChild(child);
            if (ii != null && ii.position == mCurItem
                    && child.dispatchPopulateAccessibilityEvent(event)) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:22,代码来源:YViewPagerOrigin.java

示例5: sendAccessibilityEvent

@Override
public void sendAccessibilityEvent(int eventType) {
	// Since this class calls onScrollChanged even if the mFirstPosition and
	// the
	// child count have not changed we will avoid sending duplicate
	// accessibility
	// events.
	if (eventType == AccessibilityEventCompat.TYPE_VIEW_SCROLLED) {
		final int firstVisiblePosition = getFirstVisiblePosition();
		final int lastVisiblePosition = getLastVisiblePosition();
		if (mLastAccessibilityScrollEventFromIndex == firstVisiblePosition
				&& mLastAccessibilityScrollEventToIndex == lastVisiblePosition) {
			return;
		} else {
			mLastAccessibilityScrollEventFromIndex = firstVisiblePosition;
			mLastAccessibilityScrollEventToIndex = lastVisiblePosition;
		}
	}
	super.sendAccessibilityEvent(eventType);
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:20,代码来源:AbsHListView.java

示例6: dispatchPopulateAccessibilityEvent

@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;
}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:22,代码来源:CustomViewPager.java

示例7: dispatchPopulateAccessibilityEvent

@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;
}
 
开发者ID:henryblue,项目名称:TeaCup,代码行数:22,代码来源:CenterViewPager.java

示例8: dispatchPopulateAccessibilityEvent

@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;
}
 
开发者ID:smuyyh,项目名称:SprintNBA,代码行数:21,代码来源:VerticalViewPager.java

示例9: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:13,代码来源:ViewPagerCompat.java

示例10: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
	super.onInitializeAccessibilityEvent(host, event);
	event.setClassName(CustomViewPager.class.getName());
	final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
	recordCompat.setScrollable(canScroll());
	if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
		&& mAdapter != null) {
		recordCompat.setItemCount(mAdapter.getCount());
		recordCompat.setFromIndex(mCurItem);
		recordCompat.setToIndex(mCurItem);
	}
}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:13,代码来源:CustomViewPager.java

示例11: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPagerEx.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:13,代码来源:ViewPagerEx.java

示例12: onInitializeAccessibilityEvent

public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(YViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(getAdapterCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:13,代码来源:YViewPager.java

示例13: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:14,代码来源:ViewPager.java

示例14: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(LinkagePager.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:crosswall,项目名称:Android-Coverflow,代码行数:14,代码来源:LinkagePager.java

示例15: onInitializeAccessibilityEvent

@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(VelocityViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
开发者ID:rohanoid5,项目名称:Muzesto,代码行数:13,代码来源:VelocityViewPager.java


注:本文中的android.support.v4.view.accessibility.AccessibilityEventCompat.TYPE_VIEW_SCROLLED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。