android.view.View.sendAccessibilityEvent()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(281)

本文整理了Java中android.view.View.sendAccessibilityEvent()方法的一些代码示例,展示了View.sendAccessibilityEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.sendAccessibilityEvent()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:sendAccessibilityEvent

View.sendAccessibilityEvent介绍

暂无

代码示例

代码示例来源:origin: TonicArtos/StickyGridHeaders

public boolean performHeaderClick(View view, long id) {
  if (mOnHeaderClickListener != null) {
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    mOnHeaderClickListener.onHeaderClick(this, view, id);
    return true;
  }
  return false;
}

代码示例来源:origin: TonicArtos/StickyGridHeaders

public boolean performHeaderLongPress(View view, long id) {
  boolean handled = false;
  if (mOnHeaderLongClickListener != null) {
    handled = mOnHeaderLongClickListener.onHeaderLongClick(this, view, id);
  }
  if (handled) {
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
    }
    performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
  }
  return handled;
}

代码示例来源:origin: beworker/pinned-section-listview

private boolean performPinnedItemClick() {
  if (mPinnedSection == null) return false;
  OnItemClickListener listener = getOnItemClickListener();
  if (listener != null && getAdapter().isEnabled(mPinnedSection.position)) {
    View view =  mPinnedSection.view;
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    listener.onItemClick(this, view, mPinnedSection.position, mPinnedSection.id);
    return true;
  }
  return false;
}

代码示例来源:origin: UweTrottmann/SeriesGuide

public boolean performHeaderClick(View view, long id) {
  if (mOnHeaderClickListener != null) {
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    mOnHeaderClickListener.onHeaderClick(this, view, id);
    return true;
  }
  return false;
}

代码示例来源:origin: UweTrottmann/SeriesGuide

public boolean performHeaderLongPress(View view, long id) {
  boolean handled = false;
  if (mOnHeaderLongClickListener != null) {
    handled = mOnHeaderLongClickListener.onHeaderLongClick(this, view, id);
  }
  if (handled) {
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
    }
    performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
  }
  return handled;
}

代码示例来源:origin: stackoverflow.com

playSoundEffect(SoundEffectConstants.CLICK);
if (view != null)
  view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
mOnItemClickListener.onItemClick(this, view, position, id);
return true;

代码示例来源:origin: henrichg/PhoneProfilesPlus

/**
 * Invalidates cached information about the parent view. <p> You <b>must</b> call this method after adding or
 * removing items from the parent view. </p>
 */
public void invalidateParent() {
  mParentView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}

代码示例来源:origin: enricocid/LaunchEnr

@Override
public void run() {
  mTargetView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}

代码示例来源:origin: apptentive/apptentive-android

@Override
  protected void execute() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      itemView.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT);
    }
  }
}, 500);

代码示例来源:origin: klinker24/Android-Blur-Launcher

@Override
public void run() {
  mTargetView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}

代码示例来源:origin: klinker24/launcher3

@Override
public void run() {
  mTargetView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}

代码示例来源:origin: derry/delion

private void focusInputField(View view) {
    view.requestFocus();
    view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
    if (mObserverForTest != null) mObserverForTest.onPaymentRequestReadyToEdit();
  }
}

代码示例来源:origin: enricocid/LaunchEnr

@Override
  public void run() {
    if (mCurrView != null && !mLongPressSent) {
      mLongPressSent = true;
      mCurrView.sendAccessibilityEvent(
          AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
      mCurrView.getLocationOnScreen(mTmpPos);
      final int x = (int) ev.getRawX() - mTmpPos[0];
      final int y = (int) ev.getRawY() - mTmpPos[1];
      mLongPressListener.onLongPress(mCurrView, x, y);
    }
  }
};

代码示例来源:origin: derry/delion

private void setInitialFocus() {
  InputMethodManager imm = (InputMethodManager) mDialog.getContext().getSystemService(
      Context.INPUT_METHOD_SERVICE);
  View view = mShouldRequestExpirationDate ? mMonthInput : mCardUnmaskInput;
  imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
  view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
  if (sObserverForTest != null) {
    sObserverForTest.onCardUnmaskPromptReadyForInput(this);
  }
}

代码示例来源:origin: canqihe/TmallSale

public boolean performHeaderClick(View view, long id) {
  if (mOnHeaderClickListener != null) {
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    mOnHeaderClickListener.onHeaderClick(this, view, id);
    return true;
  }
  return false;
}

代码示例来源:origin: canqihe/TmallSale

public boolean performHeaderLongPress(View view, long id) {
  boolean handled = false;
  if (mOnHeaderLongClickListener != null) {
    handled = mOnHeaderLongClickListener.onHeaderLongClick(this, view, id);
  }
  if (handled) {
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
    }
    performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
  }
  return handled;
}

代码示例来源:origin: Ryfthink/TV-HorizontalListView

public boolean performItemLongClick(View view, int position, long id) {
  OnItemLongClickListener l = getOnItemLongClickListener();
  if (l != null) {
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
      l.onItemLongClick(this, view, position, id);
    }
    return true;
  }
  return false;
}

代码示例来源:origin: JakeWharton/DrawerBehavior

private void dispatchOnDrawerClosed(View drawerView) {
 if ((openState & FLAG_IS_OPENED) == FLAG_IS_OPENED) {
  openState = 0;
  updateChildrenImportantForAccessibility(drawerView, false);
  // Only send WINDOW_STATE_CHANGE if the host has window focus. This
  // may change if support for multiple foreground windows (e.g. IME)
  // improves.
  if (parent.hasWindowFocus()) {
   final View rootView = parent.getRootView();
   if (rootView != null) {
    rootView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
   }
  }
 }
}

代码示例来源:origin: boredream/DesignResCollection

private boolean performPinnedItemClick() {
  if (mPinnedSection == null) return false;
  OnItemClickListener listener = getOnItemClickListener();
  if (listener != null && getAdapter().isEnabled(mPinnedSection.position)) {
    View view =  mPinnedSection.view;
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    listener.onItemClick(this, view, mPinnedSection.position, mPinnedSection.id);
    return true;
  }
  return false;
}

代码示例来源:origin: mzule/AndroidWeekly

private boolean performPinnedItemClick() {
  if (mPinnedSection == null) return false;
  OnItemClickListener listener = getOnItemClickListener();
  if (listener != null && getAdapter().isEnabled(mPinnedSection.position)) {
    View view = mPinnedSection.view;
    playSoundEffect(SoundEffectConstants.CLICK);
    if (view != null) {
      view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
    }
    listener.onItemClick(this, view, mPinnedSection.position, mPinnedSection.id);
    return true;
  }
  return false;
}

相关文章

View类方法