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


Java View.dispatchPopulateAccessibilityEvent方法代码示例

本文整理汇总了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;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:PLA_AdapterView.java

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

示例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;
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:23,代码来源:YViewPager.java

示例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;
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:23,代码来源:YViewPagerNew.java

示例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;
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:23,代码来源:YViewPagerOrigin.java

示例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;
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:23,代码来源:ViewPager.java

示例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;
}
 
开发者ID:simplezhli,项目名称:ChangeTabLayout,代码行数:23,代码来源:VerticalViewPager.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:17,代码来源:ViewPager.java

示例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;
}
 
开发者ID:Shmilyz,项目名称:Swap,代码行数:29,代码来源:PLA_AdapterView.java

示例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;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:10,代码来源:IcsAdapterView.java

示例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;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:10,代码来源:AdapterView.java

示例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;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:15,代码来源:AdapterView.java

示例13: dispatchPopulateAccessibilityEvent

import android.view.View; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    View selectedView = getSelectedView();
    return selectedView != null && selectedView.getVisibility() == 0 && selectedView.dispatchPopulateAccessibilityEvent(event);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:AdapterView.java


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