android.view.View.AccessibilityDelegate Java Examples

The following examples show how to use android.view.View.AccessibilityDelegate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutofillPopup.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Filters the Autofill suggestions to the ones that we support and shows the popup.
 * @param suggestions Autofill suggestion data.
 * @param isRtl @code true if right-to-left text.
 * @param backgroundColor popup background color, or {@code Color.TRANSPARENT} if unspecified.
 * @param dividerColor color for divider between popup items, or {@code Color.TRANSPARENT} if
 * unspecified.
 * @param isBoldLabel true if suggestion label's type face is {@code Typeface.BOLD}, false if
 * suggestion label's type face is {@code Typeface.NORMAL}.
 * @param dropdownItemHeight height of each dropdown item in dimension independent pixel units,
 * 0 if unspecified.
 * @param margin Margin for icon, label and between icon and label in dimension independent
 * pixel units, 0 if not specified.
 */
@SuppressLint("InlinedApi")
public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl,
        int backgroundColor, int dividerColor, int dropdownItemHeight, int margin) {
    mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
    // Remove the AutofillSuggestions with IDs that are not supported by Android
    ArrayList<DropdownItem> cleanedData = new ArrayList<DropdownItem>();
    HashSet<Integer> separators = new HashSet<Integer>();
    for (int i = 0; i < suggestions.length; i++) {
        int itemId = suggestions[i].getSuggestionId();
        if (itemId == ITEM_ID_SEPARATOR_ENTRY) {
            separators.add(cleanedData.size());
        } else {
            cleanedData.add(suggestions[i]);
        }
    }

    setAdapter(new DropdownAdapter(mContext, cleanedData, separators,
            backgroundColor == Color.TRANSPARENT ? null : backgroundColor,
            dividerColor == Color.TRANSPARENT ? null : dividerColor,
            dropdownItemHeight == 0 ? null : dropdownItemHeight,
            margin == 0 ? null : margin));
    setRtl(isRtl);
    show();
    getListView().setOnItemLongClickListener(this);
    getListView().setAccessibilityDelegate(new AccessibilityDelegate() {
        @Override
        public boolean onRequestSendAccessibilityEvent(
                ViewGroup host, View child, AccessibilityEvent event) {
            getListView().removeCallbacks(mClearAccessibilityFocusRunnable);
            if (event.getEventType()
                    == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED) {
                getListView().postDelayed(
                        mClearAccessibilityFocusRunnable, CLEAR_ACCESSIBILITY_FOCUS_DELAY_MS);
            }
            return super.onRequestSendAccessibilityEvent(host, child, event);
        }
    });
}
 
Example #2
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static Object newAccessibilityDelegateDefaultImpl() {
    return new AccessibilityDelegate();
}
 
Example #3
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static Object newAccessibilityDelegateDefaultImpl() {
    return new AccessibilityDelegate();
}
 
Example #4
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static boolean dispatchPopulateAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    return ((AccessibilityDelegate) delegate).dispatchPopulateAccessibilityEvent(host, event);
}
 
Example #5
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).onInitializeAccessibilityEvent(host, event);
}
 
Example #6
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityNodeInfo(Object delegate, View host, Object info) {
    ((AccessibilityDelegate) delegate).onInitializeAccessibilityNodeInfo(host,
            (AccessibilityNodeInfo) info);
}
 
Example #7
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void onPopulateAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).onPopulateAccessibilityEvent(host, event);
}
 
Example #8
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static boolean onRequestSendAccessibilityEvent(Object delegate, ViewGroup host,
        View child, AccessibilityEvent event) {
    return ((AccessibilityDelegate) delegate).onRequestSendAccessibilityEvent(host, child,
            event);
}
 
Example #9
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void sendAccessibilityEvent(Object delegate, View host, int eventType) {
    ((AccessibilityDelegate) delegate).sendAccessibilityEvent(host, eventType);
}
 
Example #10
Source File: AccessibilityDelegateCompatIcs.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void sendAccessibilityEventUnchecked(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).sendAccessibilityEventUnchecked(host, event);
}
 
Example #11
Source File: ViewCompatICS.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void setAccessibilityDelegate(View v, Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
Example #12
Source File: AccessibilityDelegateCompatJellyBean.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(Object delegate,
        View host) {
    return ((AccessibilityDelegate) delegate).getAccessibilityNodeProvider(host);
}
 
Example #13
Source File: AccessibilityDelegateCompatJellyBean.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static boolean performAccessibilityAction(Object delegate, View host, int action,
        Bundle args) {
    return ((AccessibilityDelegate) delegate).performAccessibilityAction(host, action, args);
}
 
Example #14
Source File: AccessibilityDelegateCompatIcs.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static void sendAccessibilityEventUnchecked(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).sendAccessibilityEventUnchecked(host, event);
}
 
Example #15
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static boolean dispatchPopulateAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    return ((AccessibilityDelegate) delegate).dispatchPopulateAccessibilityEvent(host, event);
}
 
Example #16
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).onInitializeAccessibilityEvent(host, event);
}
 
Example #17
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityNodeInfo(Object delegate, View host, Object info) {
    ((AccessibilityDelegate) delegate).onInitializeAccessibilityNodeInfo(host,
            (AccessibilityNodeInfo) info);
}
 
Example #18
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static void onPopulateAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).onPopulateAccessibilityEvent(host, event);
}
 
Example #19
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static boolean onRequestSendAccessibilityEvent(Object delegate, ViewGroup host,
        View child, AccessibilityEvent event) {
    return ((AccessibilityDelegate) delegate).onRequestSendAccessibilityEvent(host, child,
            event);
}
 
Example #20
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static void sendAccessibilityEvent(Object delegate, View host, int eventType) {
    ((AccessibilityDelegate) delegate).sendAccessibilityEvent(host, eventType);
}
 
Example #21
Source File: AccessibilityDelegateCompatIcs.java    From guideshow with MIT License 4 votes vote down vote up
public static void sendAccessibilityEventUnchecked(Object delegate, View host,
        AccessibilityEvent event) {
    ((AccessibilityDelegate) delegate).sendAccessibilityEventUnchecked(host, event);
}
 
Example #22
Source File: ViewCompatICS.java    From guideshow with MIT License 4 votes vote down vote up
public static void setAccessibilityDelegate(View v, Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
Example #23
Source File: AccessibilityDelegateCompatJellyBean.java    From guideshow with MIT License 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(Object delegate,
        View host) {
    return ((AccessibilityDelegate) delegate).getAccessibilityNodeProvider(host);
}
 
Example #24
Source File: AccessibilityDelegateCompatJellyBean.java    From guideshow with MIT License 4 votes vote down vote up
public static boolean performAccessibilityAction(Object delegate, View host, int action,
        Bundle args) {
    return ((AccessibilityDelegate) delegate).performAccessibilityAction(host, action, args);
}
 
Example #25
Source File: ViewCompatICS.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static void setAccessibilityDelegate(View v, Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
Example #26
Source File: ViewCompatICS.java    From letv with Apache License 2.0 4 votes vote down vote up
public static void setAccessibilityDelegate(View v, @Nullable Object delegate) {
    v.setAccessibilityDelegate((AccessibilityDelegate) delegate);
}
 
Example #27
Source File: AccessibilityDelegateCompatJellyBean.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(Object delegate,
        View host) {
    return ((AccessibilityDelegate) delegate).getAccessibilityNodeProvider(host);
}
 
Example #28
Source File: AccessibilityDelegateCompatJellyBean.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static boolean performAccessibilityAction(Object delegate, View host, int action,
        Bundle args) {
    return ((AccessibilityDelegate) delegate).performAccessibilityAction(host, action, args);
}
 
Example #29
Source File: AccessibilityDelegateCompatIcs.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static Object newAccessibilityDelegateDefaultImpl() {
    return new AccessibilityDelegate();
}
 
Example #30
Source File: AccessibilityDelegateCompatIcs.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static boolean dispatchPopulateAccessibilityEvent(Object delegate, View host,
        AccessibilityEvent event) {
    return ((AccessibilityDelegate) delegate).dispatchPopulateAccessibilityEvent(host, event);
}