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


Java View.setImportantForAccessibility方法代码示例

本文整理汇总了Java中android.view.View.setImportantForAccessibility方法的典型用法代码示例。如果您正苦于以下问题:Java View.setImportantForAccessibility方法的具体用法?Java View.setImportantForAccessibility怎么用?Java View.setImportantForAccessibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.setImportantForAccessibility方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setEmptyView

import android.view.View; //导入方法依赖的package包/类
/**
 * Sets the view to show if the adapter is empty
 */
@TargetApi(16)
public void setEmptyView( View emptyView ) {
	mEmptyView = emptyView;

	if( android.os.Build.VERSION.SDK_INT >= 16 ) {
		// If not explicitly specified this view is important for accessibility.
		if ( emptyView != null && emptyView.getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO ) {
			emptyView.setImportantForAccessibility( IMPORTANT_FOR_ACCESSIBILITY_YES );
		}
	}

	final T adapter = getAdapter();
	final boolean empty = ( ( adapter == null ) || adapter.isEmpty() );
	updateEmptyStatus( empty );
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:19,代码来源:AdapterView.java

示例3: setAccessibilityIgnore

import android.view.View; //导入方法依赖的package包/类
public static void setAccessibilityIgnore(View view) {
    view.setClickable(false);
    view.setFocusable(false);
    view.setContentDescription("");
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:9,代码来源:UIUtils.java

示例4: addNotificationIconForInfo

import android.view.View; //导入方法依赖的package包/类
/**
 * Creates an icon for the given NotificationInfo, and adds it to the icon row.
 * @return the icon view that was added
 */
private View addNotificationIconForInfo(NotificationInfo info) {
    View icon = new View(getContext());
    icon.setBackground(info.getIconForBackground(getContext(), mBackgroundColor));
    icon.setOnClickListener(info);
    icon.setTag(info);
    icon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
    mIconRow.addView(icon, 0, mIconLayoutParams);
    return icon;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:14,代码来源:NotificationFooterLayout.java

示例5: setAccessiblityIgnore

import android.view.View; //导入方法依赖的package包/类
public static void setAccessiblityIgnore(View view) {
	view.setClickable(false);
	view.setFocusable(false);
	view.setContentDescription("");
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
		view.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
	}
}
 
开发者ID:Gookler,项目名称:RxJanDan,代码行数:9,代码来源:UIUtil.java

示例6: setAriaHidden

import android.view.View; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
protected void setAriaHidden(boolean isHidden) {
  View host = getHostView();
  if(host != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
    host.setImportantForAccessibility(isHidden?View.IMPORTANT_FOR_ACCESSIBILITY_NO:View.IMPORTANT_FOR_ACCESSIBILITY_YES);
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:8,代码来源:WXComponent.java

示例7: setEmptyView

import android.view.View; //导入方法依赖的package包/类
@TargetApi(16)
public void setEmptyView(View emptyView) {
    boolean empty = true;
    this.mEmptyView = emptyView;
    if (VERSION.SDK_INT >= 16 && emptyView != null && emptyView.getImportantForAccessibility() == 0) {
        emptyView.setImportantForAccessibility(1);
    }
    T adapter = getAdapter();
    if (!(adapter == null || adapter.isEmpty())) {
        empty = false;
    }
    updateEmptyStatus(empty);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:AdapterView.java

示例8: hideFromAccessibility

import android.view.View; //导入方法依赖的package包/类
@TargetApi(16)
private void hideFromAccessibility(View view, boolean hide) {
	view.setImportantForAccessibility(hide ?
			View.IMPORTANT_FOR_ACCESSIBILITY_NO : View.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:HostListActivity.java

示例9: setImportantForAccessibility

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


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