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


Java AccessibilityEvent.setContentDescription方法代码示例

本文整理汇总了Java中android.view.accessibility.AccessibilityEvent.setContentDescription方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityEvent.setContentDescription方法的具体用法?Java AccessibilityEvent.setContentDescription怎么用?Java AccessibilityEvent.setContentDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.accessibility.AccessibilityEvent的用法示例。


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

示例1: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
protected void onPopulateEventForVirtualView(int id, AccessibilityEvent event) {
    if (id == INVALID_ID) {
        throw new IllegalArgumentException("Invalid virtual view id");
    }
    event.setContentDescription(mContext.getString(R.string.action_move_here));
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:8,代码来源:DragAndDropAccessibilityDelegate.java

示例2: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
        // Action mode started
        //TODO event.setSource(this);
        event.setClassName(getClass().getName());
        event.setPackageName(getContext().getPackageName());
        event.setContentDescription(mTitle);
    } else {
        //TODO super.onInitializeAccessibilityEvent(event);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:13,代码来源:ActionBarContextView.java

示例3: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
protected void onPopulateEventForVirtualView(int virtualViewId, AccessibilityEvent event) {
    if (mVirtualViews == null || mVirtualViews.size() <= virtualViewId) {
        // TODO(clholgat): Remove this work around when the Android bug is fixed.
        // crbug.com/420177
        event.setContentDescription(PLACE_HOLDER_STRING);
        return;
    }
    VirtualView view = mVirtualViews.get(virtualViewId);

    event.setContentDescription(view.getAccessibilityDescription());
    event.setClassName(CompositorViewHolder.class.getName());
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:CompositorViewHolder.java

示例4: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    if (VERSION.SDK_INT < 14) {
        return;
    }
    if (event.getEventType() == 32) {
        event.setSource(this);
        event.setClassName(getClass().getName());
        event.setPackageName(getContext().getPackageName());
        event.setContentDescription(this.mTitle);
        return;
    }
    super.onInitializeAccessibilityEvent(event);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:ActionBarContextView.java

示例5: createAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/**
 * Creates and populates an {@link AccessibilityEvent} for the specified key
 * and event type.
 *
 * @param key A key on the host keyboard view.
 * @param eventType The event type to create.
 * @return A populated {@link AccessibilityEvent} for the key.
 * @see AccessibilityEvent
 */
public AccessibilityEvent createAccessibilityEvent(final Key key, final int eventType) {
    final int virtualViewId = getVirtualViewIdOf(key);
    final String keyDescription = getKeyDescription(key);
    final AccessibilityEvent event = AccessibilityEvent.obtain(eventType);
    event.setPackageName(mKeyboardView.getContext().getPackageName());
    event.setClassName(key.getClass().getName());
    event.setContentDescription(keyDescription);
    event.setEnabled(true);
    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    record.setSource(mKeyboardView, virtualViewId);
    return event;
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:22,代码来源:KeyboardAccessibilityNodeProvider.java

示例6: sendWindowStateChanged

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/**
 * Sends a window state change event with the specified text.
 *
 * @param text The text to send with the event.
 */
protected void sendWindowStateChanged(final String text) {
    final AccessibilityEvent stateChange = AccessibilityEvent.obtain(
            AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
    mKeyboardView.onInitializeAccessibilityEvent(stateChange);
    stateChange.getText().add(text);
    stateChange.setContentDescription(null);

    final ViewParent parent = mKeyboardView.getParent();
    if (parent != null) {
        parent.requestSendAccessibilityEvent(mKeyboardView, stateChange);
    }
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:18,代码来源:KeyboardAccessibilityDelegate.java

示例7: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
protected void onPopulateEventForVirtualView(int virtualViewId, AccessibilityEvent event) {
    event.setClassName(getClass().getName());

    final int type = getTypeFromId(virtualViewId);
    final int value = getValueFromId(virtualViewId);
    final CharSequence description = getVirtualViewDescription(type, value);
    event.setContentDescription(description);
}
 
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:10,代码来源:RadialTimePickerView.java

示例8: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
protected void onPopulateEventForVirtualView(int virtualViewId, AccessibilityEvent event) {
    event.setContentDescription(getItemDescription(virtualViewId));
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:5,代码来源:MonthView.java

示例9: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
protected void onPopulateEventForVirtualView(int virtualViewId, AccessibilityEvent event) {
    event.setContentDescription(getItemDescription(virtualViewId));
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:MonthView.java

示例10: onPopulateEventForVirtualView

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
protected void onPopulateEventForVirtualView(int virtualViewId, AccessibilityEvent event) {
    event.setContentDescription(getDayDescription(virtualViewId));
}
 
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:5,代码来源:SimpleMonthView.java


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