當前位置: 首頁>>代碼示例>>Java>>正文


Java View.getImportantForAccessibility方法代碼示例

本文整理匯總了Java中android.view.View.getImportantForAccessibility方法的典型用法代碼示例。如果您正苦於以下問題:Java View.getImportantForAccessibility方法的具體用法?Java View.getImportantForAccessibility怎麽用?Java View.getImportantForAccessibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.View的用法示例。


在下文中一共展示了View.getImportantForAccessibility方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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

示例4: getImportantForAccessibility

import android.view.View; //導入方法依賴的package包/類
public static int getImportantForAccessibility(View view) {
    return view.getImportantForAccessibility();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:4,代碼來源:ViewCompatJB.java


注:本文中的android.view.View.getImportantForAccessibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。