本文整理汇总了Java中android.view.View.sendAccessibilityEvent方法的典型用法代码示例。如果您正苦于以下问题:Java View.sendAccessibilityEvent方法的具体用法?Java View.sendAccessibilityEvent怎么用?Java View.sendAccessibilityEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.sendAccessibilityEvent方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateAccessibilityVisibility
import android.view.View; //导入方法依赖的package包/类
/**
* Update whether or not the current native tab and/or web contents are
* currently visible (from an accessibility perspective), or whether
* they're obscured by another view.
*/
public void updateAccessibilityVisibility() {
View view = getView();
if (view != null) {
int importantForAccessibility = isObscuredByAnotherViewForAccessibility()
? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
: View.IMPORTANT_FOR_ACCESSIBILITY_YES;
if (view.getImportantForAccessibility() != importantForAccessibility) {
view.setImportantForAccessibility(importantForAccessibility);
view.sendAccessibilityEvent(
AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
}
}
ContentViewCore cvc = getContentViewCore();
if (cvc != null) {
boolean isWebContentObscured = isObscuredByAnotherViewForAccessibility()
|| isShowingSadTab();
cvc.setObscuredByAnotherView(isWebContentObscured);
}
}
示例2: dispatchOnDrawerClosed
import android.view.View; //导入方法依赖的package包/类
void dispatchOnDrawerClosed(View drawerView) {
LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
if ((lp.openState & 1) == 1) {
lp.openState = 0;
if (this.mListeners != null) {
for (int i = this.mListeners.size() - 1; i >= 0; i--) {
((DrawerListener) this.mListeners.get(i)).onDrawerClosed(drawerView);
}
}
updateChildrenImportantForAccessibility(drawerView, false);
if (hasWindowFocus()) {
View rootView = getRootView();
if (rootView != null) {
rootView.sendAccessibilityEvent(32);
}
}
}
}
示例3: dispatchOnDrawerClosed
import android.view.View; //导入方法依赖的package包/类
void dispatchOnDrawerClosed(View drawerView) {
final LayoutParams lp = (LayoutParams) drawerView.getLayoutParams();
if (lp.knownOpen) {
lp.knownOpen = false;
if (mListener != null) {
mListener.onDrawerClosed(drawerView);
}
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 (hasWindowFocus()) {
final View rootView = getRootView();
if (rootView != null) {
rootView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
}
}
}
示例4: performPinnedItemClick
import android.view.View; //导入方法依赖的package包/类
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;
}
示例5: performItemClick
import android.view.View; //导入方法依赖的package包/类
/**
* Call the OnItemClickListener, if it is defined.
*
* @param view The view within the AdapterView that was clicked.
* @param position The position of the view in the adapter.
* @param id The row id of the item that was clicked.
* @return True if there was an assigned OnItemClickListener that was
* called, false otherwise is returned.
*/
public boolean performItemClick(View view, int position, long id) {
if (mOnItemClickListener != null) {
playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemClickListener.onItemClick(/*this*/null, view, position, id);
return true;
}
return false;
}
示例6: setInitialFocus
import android.view.View; //导入方法依赖的package包/类
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);
}
}
示例7: performItemClick
import android.view.View; //导入方法依赖的package包/类
public boolean performItemClick(View view, int position, long id) {
if (this.mOnItemClickListener == null) {
return false;
}
playSoundEffect(0);
if (view != null) {
view.sendAccessibilityEvent(1);
}
this.mOnItemClickListener.onItemClick(this, view, position, id);
return true;
}
示例8: performItemClick
import android.view.View; //导入方法依赖的package包/类
/**
* Call the OnItemClickListener, if it is defined.
*
* @param view
* The view within the AdapterView that was clicked.
* @param position
* The position of the view in the adapter.
* @param id
* The col id of the item that was clicked.
* @return True if there was an assigned OnItemClickListener that was called, false otherwise is returned.
*/
public boolean performItemClick( View view, int position, long id ) {
if ( mOnItemClickListener != null ) {
playSoundEffect( SoundEffectConstants.CLICK );
if ( view != null ) {
view.sendAccessibilityEvent( AccessibilityEvent.TYPE_VIEW_CLICKED );
}
mOnItemClickListener.onItemClick( this, view, position, id );
return true;
}
return false;
}
示例9: performItemClick
import android.view.View; //导入方法依赖的package包/类
public boolean performItemClick(View paramView, int paramInt, long paramLong) {
if (this.mOnItemClickListener != null) {
playSoundEffect(0);
if (paramView != null)
paramView.sendAccessibilityEvent(1);
this.mOnItemClickListener.onItemClick(this, paramView, paramInt, paramLong);
return true;
}
return false;
}
示例10: performPinnedItemClick
import android.view.View; //导入方法依赖的package包/类
private boolean performPinnedItemClick() {
if (mPinnedSection == null) return false;
OnItemClickListener listener = getOnItemClickListener();
if (listener != null) {
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;
}
示例11: sendAccessibilityEvent
import android.view.View; //导入方法依赖的package包/类
public static void sendAccessibilityEvent(View view, int eventType) {
view.sendAccessibilityEvent(eventType);
}
示例12: performItemClick
import android.view.View; //导入方法依赖的package包/类
/**
* Call the OnItemClickListener, if it is defined. Performs all normal
* actions associated with clicking: reporting accessibility event, playing
* a sound, etc.
*
* @param view
* The view within the AdapterView that was clicked.
* @param position
* The position of the view in the adapter.
* @param id
* The row id of the item that was clicked.
* @return True if there was an assigned OnItemClickListener that was
* called, false otherwise is returned.
*/
public boolean performItemClick(View view, int sectionIndex, int positionInSection, long id) {
if (mOnItemClickListener != null) {
// playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemClickListener.onItemClick(this, getFreeFlowItemForVisibleItemAt(sectionIndex, positionInSection));
return true;
}
return false;
}