Example usage for android.view.accessibility AccessibilityEvent setClassName

List of usage examples for android.view.accessibility AccessibilityEvent setClassName

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityEvent setClassName.

Prototype

public void setClassName(CharSequence className) 

Source Link

Document

Sets the class name of the source.

Usage

From source file:com.actionbarsherlock.internal.widget.ActionBarContextView.java

@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 {//from   w  w  w. ja v  a2s . c om
        //TODO super.onInitializeAccessibilityEvent(event);
    }
}

From source file:com.albedinsky.android.support.ui.widget.ScrollViewWidget.java

/**
 *///from   w  ww .  j ava 2 s  .co  m
@Override
public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(ScrollViewWidget.class.getName());
}

From source file:CookieVideoView.java

@SuppressLint("NewApi")
@Override/*from  ww  w.  j a va 2  s  .  c  o m*/
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(CookieVideoView.class.getName());
}

From source file:com.albedinsky.android.support.ui.widget.HorizontalScrollViewWidget.java

/**
 *///from   w ww .  ja v a  2  s  .  co m
@Override
public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(HorizontalScrollViewWidget.class.getName());
}

From source file:com.massivekinetics.ow.ui.views.timepicker.TimePicker.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        super.onInitializeAccessibilityEvent(event);
    event.setClassName(TimePicker.class.getName());
}

From source file:com.android.utils.ExploreByTouchHelper.java

/**
 * Constructs and returns an {@link AccessibilityEvent} populated with
 * information about the specified item.
 *
 * @param virtualViewId The virtual view id for the item for which to
 *            construct an event./*from  ww w .ja v a  2 s  . c  o m*/
 * @param eventType The type of event to construct.
 * @return An {@link AccessibilityEvent} populated with information about
 *         the specified item.
 */
private AccessibilityEvent getEventForVirtualViewId(int virtualViewId, int eventType) {
    final AccessibilityEvent event = AccessibilityEvent.obtain(eventType);

    // Ensure the client has good defaults.
    event.setEnabled(true);
    event.setClassName(mHost.getClass().getName() + DEFAULT_CLASS_NAME);

    // Allow the client to populate the event.
    populateEventForVirtualViewId(virtualViewId, event);

    if (event.getText().isEmpty() && TextUtils.isEmpty(event.getContentDescription())) {
        throw new RuntimeException("You must add text or a content description in populateEventForItem()");
    }

    // Don't allow the client to override these properties.
    event.setPackageName(mHost.getContext().getPackageName());

    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    record.setSource(mHost, virtualViewId);

    return event;
}

From source file:com.googlecode.eyesfree.utils.ExploreByTouchHelper.java

/**
 * Constructs and returns an {@link AccessibilityEvent} populated with
 * information about the specified item.
 *
 * @param virtualViewId The virtual view id for the item for which to
 *            construct an event.//from   w ww  .  j a va  2 s .c om
 * @param eventType The type of event to construct.
 * @return An {@link AccessibilityEvent} populated with information about
 *         the specified item.
 */
private AccessibilityEvent getEventForVirtualViewId(int virtualViewId, int eventType) {
    final AccessibilityEvent event = AccessibilityEvent.obtain(eventType);

    // Ensure the client has good defaults.
    event.setEnabled(true);
    event.setClassName(mHost.getClass().getName() + DEFAULT_CLASS_NAME);

    // Allow the client to populate the event.
    populateEventForVirtualViewId(virtualViewId, event);

    if (event.getText().isEmpty() && TextUtils.isEmpty(event.getContentDescription())) {
        throw new RuntimeException("You must add text or a content description in populateEventForItem()");
    }

    // Don't allow the client to override these properties.
    event.setPackageName(mHost.getContext().getPackageName());

    // Virtual view hierarchies are only supported in API 16+.
    final AccessibilityRecordCompat record = new AccessibilityRecordCompat(event);
    record.setSource(mHost, virtualViewId);

    return event;
}

From source file:android.support.v7.internal.widget.ActionBarContextView.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    if (Build.VERSION.SDK_INT >= 14) {
        if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
            // Action mode started
            event.setSource(this);
            event.setClassName(getClass().getName());
            event.setPackageName(getContext().getPackageName());
            event.setContentDescription(mTitle);
        } else {/* w  w w. j a v a  2s.  c o m*/
            super.onInitializeAccessibilityEvent(event);
        }
    }
}

From source file:com.tasomaniac.openwith.resolver.ResolverDrawerLayout.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(ResolverDrawerLayout.class.getName());
}

From source file:com.atomjack.vcfp.VideoControllerView.java

@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(VideoControllerView.class.getName());
}