當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。