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


Java ViewParentCompat类代码示例

本文整理汇总了Java中android.support.v4.view.ViewParentCompat的典型用法代码示例。如果您正苦于以下问题:Java ViewParentCompat类的具体用法?Java ViewParentCompat怎么用?Java ViewParentCompat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: sendAccessibilityEventForVirtualText

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
private void sendAccessibilityEventForVirtualText(int eventType) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        ViewCompat.onInitializeAccessibilityEvent(getInputText(), event);
        ViewCompat.onPopulateAccessibilityEvent(getInputText(), event);
        record.setSource(mNumberPicker, VIRTUAL_VIEW_ID_INPUT);

        ViewParentCompat.requestSendAccessibilityEvent(mNumberPicker, mNumberPicker, event);
    }
}
 
开发者ID:h6ah4i,项目名称:android-numberpickercompat,代码行数:13,代码来源:AccessibilityNodeProviderImpl.java

示例2: sendAccessibilityEventForVirtualButton

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
private void sendAccessibilityEventForVirtualButton(int virtualViewId, int eventType,
                                                    String text) {
    AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        event.setPackageName(getContext().getPackageName());
        record.setClassName(Button.class.getName());
        record.getText().add(text);
        record.setEnabled(isEnabled());
        record.setSource(mNumberPicker, virtualViewId);

        ViewParentCompat.requestSendAccessibilityEvent(mNumberPicker, mNumberPicker, event);
    }
}
 
开发者ID:h6ah4i,项目名称:android-numberpickercompat,代码行数:16,代码来源:AccessibilityNodeProviderImpl.java

示例3: sendEventForVirtualView

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
    if (virtualViewId == Integer.MIN_VALUE || !this.mManager.isEnabled()) {
        return false;
    }
    ViewParent parent = this.mView.getParent();
    if (parent == null) {
        return false;
    }
    return ViewParentCompat.requestSendAccessibilityEvent(parent, this.mView, createEvent(virtualViewId, eventType));
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:ExploreByTouchHelper.java

示例4: sendEventForVirtualView

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
public boolean sendEventForVirtualView(int l, int i1)
{
    android.view.ViewParent viewparent;
    if (l != 0x80000000 && g.isEnabled())
    {
        if ((viewparent = h.getParent()) != null)
        {
            AccessibilityEvent accessibilityevent = a(l, i1);
            return ViewParentCompat.requestSendAccessibilityEvent(viewparent, h, accessibilityevent);
        }
    }
    return false;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:ExploreByTouchHelper.java

示例5: sendEventForVirtualView

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
public boolean sendEventForVirtualView(int i, int j)
{
    android.view.ViewParent viewparent;
    if (i != 0x80000000 && mManager.isEnabled())
    {
        if ((viewparent = mView.getParent()) != null)
        {
            AccessibilityEvent accessibilityevent = createEvent(i, j);
            return ViewParentCompat.requestSendAccessibilityEvent(viewparent, mView, accessibilityevent);
        }
    }
    return false;
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:14,代码来源:ExploreByTouchHelper.java

示例6: sendEventForVirtualView

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
/**
 * Populates an event of the specified type with information about an item
 * and attempts to send it up through the view hierarchy.
 * <p>
 * You should call this method after performing a user action that normally
 * fires an accessibility event, such as clicking on an item.
 *
 * <pre>public void performItemClick(T item) {
 *   ...
 *   sendEventForVirtualViewId(item.id, AccessibilityEvent.TYPE_VIEW_CLICKED);
 * }
 * </pre>
 *
 * @param virtualViewId The virtual view id for which to send an event.
 * @param eventType The type of event to send.
 * @return true if the event was sent successfully.
 */
public boolean sendEventForVirtualView(int virtualViewId, int eventType) {
    if ((virtualViewId == INVALID_ID) || !mManager.isEnabled()) {
        return false;
    }

    final ViewParent parent = mView.getParent();
    if (parent == null) {
        return false;
    }

    final AccessibilityEvent event = createEvent(virtualViewId, eventType);
    return ViewParentCompat.requestSendAccessibilityEvent(parent, mView, event);
}
 
开发者ID:bestarandyan,项目名称:ShoppingMall,代码行数:31,代码来源:ExploreByTouchHelper.java

示例7: sendEventForItem

import android.support.v4.view.ViewParentCompat; //导入依赖的package包/类
/**
 * Populates an event of the specified type with information about an item
 * and attempts to send it up through the view hierarchy.
 * 
 * @param item
 *            The item for which to send an event.
 * @param eventType
 *            The type of event to send.
 * @return {@code true} if the event was sent successfully.
 */
public boolean sendEventForItem(T item, int eventType) {
	if (!mManager.isEnabled()) {
		return false;
	}

	final AccessibilityEvent event = getEventForItem(item, eventType);
	final ViewGroup group = (ViewGroup) mParentView.getParent();
	return ViewParentCompat.requestSendAccessibilityEvent(group, mParentView, event);
}
 
开发者ID:RedInput,项目名称:DateTimePickerCompat,代码行数:20,代码来源:TouchExplorationHelper.java


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