本文整理汇总了Java中android.view.View.dispatchPopulateAccessibilityEvent方法的典型用法代码示例。如果您正苦于以下问题:Java View.dispatchPopulateAccessibilityEvent方法的具体用法?Java View.dispatchPopulateAccessibilityEvent怎么用?Java View.dispatchPopulateAccessibilityEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.dispatchPopulateAccessibilityEvent方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
boolean populated = false;
if (event.getEventType() == 8) {
event.setEventType(4);
}
View selectedView = getSelectedView();
if (selectedView != null) {
populated = selectedView.dispatchPopulateAccessibilityEvent(event);
}
if (!populated) {
if (selectedView != null) {
event.setEnabled(selectedView.isEnabled());
}
event.setItemCount(getCount());
event.setCurrentItemIndex(getSelectedItemPosition());
}
return populated;
}
示例2: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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;
}
示例3: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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;
}
示例4: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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 YViewPagerNew.ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem
&& child.dispatchPopulateAccessibilityEvent(event)) {
return true;
}
}
}
return false;
}
示例5: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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;
}
示例6: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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 ViewPager.ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == mCurItem
&& child.dispatchPopulateAccessibilityEvent(event)) {
return true;
}
}
}
return false;
}
示例7: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@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;
}
示例8: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
if (event.getEventType() == 4096) {
return super.dispatchPopulateAccessibilityEvent(event);
}
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (child.getVisibility() == 0) {
ItemInfo ii = infoForChild(child);
if (ii != null && ii.position == this.mCurItem && child.dispatchPopulateAccessibilityEvent(event)) {
return true;
}
}
}
return false;
}
示例9: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
boolean populated = false;
// This is an exceptional case which occurs when a window gets the
// focus and sends a focus event via its focused child to announce
// current focus/selection. AdapterView fires selection but not focus
// events so we change the event type here.
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
}
// we send selection events only from AdapterView to avoid
// generation of such event for each child
View selectedView = getSelectedView();
if (selectedView != null) {
populated = selectedView.dispatchPopulateAccessibilityEvent(event);
}
if (!populated) {
if (selectedView != null) {
event.setEnabled(selectedView.isEnabled());
}
event.setItemCount(getCount());
event.setCurrentItemIndex(getSelectedItemPosition());
}
return populated;
}
示例10: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
View selectedView = getSelectedView();
if (selectedView != null && selectedView.getVisibility() == VISIBLE
&& selectedView.dispatchPopulateAccessibilityEvent(event)) {
return true;
}
return false;
}
示例11: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@Override
public boolean dispatchPopulateAccessibilityEvent( AccessibilityEvent event ) {
View selectedView = getSelectedView();
if ( selectedView != null && selectedView.getVisibility() == VISIBLE
&& selectedView.dispatchPopulateAccessibilityEvent( event ) ) {
return true;
}
return false;
}
示例12: onRequestSendAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
@TargetApi(14)
@Override
public boolean onRequestSendAccessibilityEvent( View child, AccessibilityEvent event ) {
if ( super.onRequestSendAccessibilityEvent( child, event ) ) {
// Add a record for ourselves as well.
AccessibilityEvent record = AccessibilityEvent.obtain();
onInitializeAccessibilityEvent( record );
// Populate with the text of the requesting child.
child.dispatchPopulateAccessibilityEvent( record );
event.appendRecord( record );
return true;
}
return false;
}
示例13: dispatchPopulateAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
View selectedView = getSelectedView();
return selectedView != null && selectedView.getVisibility() == 0 && selectedView.dispatchPopulateAccessibilityEvent(event);
}