当前位置: 首页>>代码示例>>Java>>正文


Java View.sendAccessibilityEvent方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:26,代码来源:Tab.java

示例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);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:DrawerLayout.java

示例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);
      }
    }
  }
}
 
开发者ID:rogues-dev,项目名称:superglue,代码行数:22,代码来源:DebugDrawerLayout.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:PinnedSectionListView.java

示例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;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:22,代码来源:IcsAdapterView.java

示例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);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:CardUnmaskPrompt.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:AdapterView.java

示例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;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:24,代码来源:AdapterView.java

示例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;
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:11,代码来源:AdapterView.java

示例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;
}
 
开发者ID:nordfalk,项目名称:EsperantoRadio,代码行数:16,代码来源:PinnedSectionListView.java

示例11: sendAccessibilityEvent

import android.view.View; //导入方法依赖的package包/类
public static void sendAccessibilityEvent(View view, int eventType) {
  view.sendAccessibilityEvent(eventType);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:4,代码来源:AccessibilityHelper.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:AbsLayoutContainer.java


注:本文中的android.view.View.sendAccessibilityEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。