本文整理汇总了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);
}
}
示例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);
}
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}