本文整理匯總了Java中android.view.accessibility.AccessibilityNodeInfo.setContentDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityNodeInfo.setContentDescription方法的具體用法?Java AccessibilityNodeInfo.setContentDescription怎麽用?Java AccessibilityNodeInfo.setContentDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.accessibility.AccessibilityNodeInfo
的用法示例。
在下文中一共展示了AccessibilityNodeInfo.setContentDescription方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(DefaultTimeBar.class.getCanonicalName());
info.setContentDescription(getProgressText());
if (duration <= 0) {
return;
}
if (Util.SDK_INT >= 21) {
info.addAction(AccessibilityAction.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityAction.ACTION_SCROLL_BACKWARD);
} else if (Util.SDK_INT >= 16) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
示例2: onInitializeAccessibilityNodeInfo
import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(21)
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setClassName(com.google.android.exoplayer2.ui.DefaultTimeBar.class.getCanonicalName());
info.setContentDescription(getProgressText());
if (duration <= 0) {
return;
}
if (Util.SDK_INT >= 21) {
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
} else if (Util.SDK_INT >= 16) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}