本文整理汇总了Java中android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES属性的典型用法代码示例。如果您正苦于以下问题:Java View.IMPORTANT_FOR_ACCESSIBILITY_YES属性的具体用法?Java View.IMPORTANT_FOR_ACCESSIBILITY_YES怎么用?Java View.IMPORTANT_FOR_ACCESSIBILITY_YES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.View
的用法示例。
在下文中一共展示了View.IMPORTANT_FOR_ACCESSIBILITY_YES属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateAccessibilityVisibility
/**
* 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);
}
}