當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。