當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。