Java Code Examples for android.view.View#onInitializeAccessibilityEvent()

The following examples show how to use android.view.View#onInitializeAccessibilityEvent() . 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: SwitchPreference.java    From holoaccent with Apache License 2.0 6 votes vote down vote up
/** As defined in TwoStatePreference source */
void sendAccessibilityEvent(View view) {
    // Since the view is still not attached we create, populate,
    // and send the event directly since we do not know when it
    // will be attached and posting commands is not as clean.
	AccessibilityManager accessibilityManager =
	        (AccessibilityManager)getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
	if (accessibilityManager == null)
		return;
    if (mSendClickAccessibilityEvent && accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain();
        event.setEventType(AccessibilityEvent.TYPE_VIEW_CLICKED);
        view.onInitializeAccessibilityEvent(event);
        view.dispatchPopulateAccessibilityEvent(event);
        accessibilityManager.sendAccessibilityEvent(event);
    }
    mSendClickAccessibilityEvent = false;
}
 
Example 2
Source File: Utilities.java    From LaunchEnr with GNU General Public License v3.0 5 votes vote down vote up
public static void sendCustomAccessibilityEvent(View target, int type, String text) {
    AccessibilityManager accessibilityManager = (AccessibilityManager)
            target.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(type);
        target.onInitializeAccessibilityEvent(event);
        event.getText().add(text);
        accessibilityManager.sendAccessibilityEvent(event);
    }
}
 
Example 3
Source File: ViewCompatICS.java    From letv with Apache License 2.0 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 4
Source File: al.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static void b(View view, AccessibilityEvent accessibilityevent)
{
    view.onInitializeAccessibilityEvent(accessibilityevent);
}
 
Example 5
Source File: ViewCompatICS.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 6
Source File: ViewCompatICS.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 7
Source File: ViewCompatICS.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 8
Source File: ViewCompatICS.java    From guideshow with MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}