下面列出了android.view.accessibility.AccessibilityNodeInfo#setPackageName ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected AccessibilityNodeInfo provideAccessibilityNodeInfo(View parent, Context context) {
final AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain();
node.setSource(parent, id);
node.setPackageName(context.getPackageName());
node.setClassName(getClassName());
node.setEditable(editable);
node.setViewIdResourceName(idEntry);
node.setVisibleToUser(true);
final Rect absBounds = line.getAbsCoordinates();
if (absBounds != null) {
node.setBoundsInScreen(absBounds);
}
if (TextUtils.getTrimmedLength(text) > 0) {
// TODO: Must checked trimmed length because input fields use 8 empty spaces to
// set width
node.setText(text);
}
return node;
}
private AccessibilityNodeInfo onProvideAutofillCompatModeAccessibilityNodeInfo() {
final AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain();
final String packageName = getContext().getPackageName();
node.setPackageName(packageName);
node.setClassName(getClass().getName());
final int childrenSize = mVirtualViews.size();
for (int i = 0; i < childrenSize; i++) {
final Item item = mVirtualViews.valueAt(i);
if (DEBUG) {
Log.d(TAG, "Adding new A11Y child with id " + item.id + ": " + item);
}
node.addChild(this, item.id);
}
return node;
}
protected AccessibilityNodeInfo provideAccessibilityNodeInfo(View parent, Context context) {
final AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain();
node.setSource(parent, id);
node.setPackageName(context.getPackageName());
node.setClassName(getClassName());
node.setEditable(editable);
node.setViewIdResourceName(idEntry);
node.setVisibleToUser(true);
final Rect absBounds = line.getAbsCoordinates();
if (absBounds != null) {
node.setBoundsInScreen(absBounds);
}
if (TextUtils.getTrimmedLength(text) > 0) {
// TODO: Must checked trimmed length because input fields use 8 empty spaces to
// set width
node.setText(text);
}
return node;
}
private AccessibilityNodeInfo onProvideAutofillCompatModeAccessibilityNodeInfo() {
final AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain();
final String packageName = getContext().getPackageName();
node.setPackageName(packageName);
node.setClassName(getClass().getName());
final int childrenSize = mVirtualViews.size();
for (int i = 0; i < childrenSize; i++) {
final Item item = mVirtualViews.valueAt(i);
if (DEBUG) {
Log.d(TAG, "Adding new A11Y child with id " + item.id + ": " + item);
}
node.addChild(this, item.id);
}
return node;
}
/**
* @see AccessibilityNodeProvider#createAccessibilityNodeInfo(int)
*/
protected AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
if (!mAccessibilityManager.isEnabled() || mNativeObj == 0 || !mFrameInfoInitialized) {
return null;
}
int rootId = nativeGetRootId(mNativeObj);
if (virtualViewId == View.NO_ID) {
virtualViewId = rootId;
}
if (mAccessibilityFocusId == View.NO_ID) {
mAccessibilityFocusId = rootId;
}
final AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(mView);
info.setPackageName(mContentViewCore.getContext().getPackageName());
info.setSource(mView, virtualViewId);
if (nativePopulateAccessibilityNodeInfo(mNativeObj, info, virtualViewId)) {
return info;
} else {
return null;
}
}
/**
* This should really be in AccessibilityNodeInfoCompat, but there unfortunately
* seem to be a few elements that are not easily cloneable using the underlying API.
* Leave it private here as it's not general-purpose useful.
*/
private void copyNodeInfoNoChildren(AccessibilityNodeInfo dest, AccessibilityNodeInfo src) {
final Rect rect = mTmpRect;
src.getBoundsInParent(rect);
dest.setBoundsInParent(rect);
src.getBoundsInScreen(rect);
dest.setBoundsInScreen(rect);
dest.setVisibleToUser(src.isVisibleToUser());
dest.setPackageName(src.getPackageName());
dest.setClassName(src.getClassName());
dest.setContentDescription(src.getContentDescription());
dest.setEnabled(src.isEnabled());
dest.setClickable(src.isClickable());
dest.setFocusable(src.isFocusable());
dest.setFocused(src.isFocused());
dest.setAccessibilityFocused(src.isAccessibilityFocused());
dest.setSelected(src.isSelected());
dest.setLongClickable(src.isLongClickable());
dest.addAction(src.getActions());
}
/**
* @see AccessibilityNodeProvider#createAccessibilityNodeInfo(int)
*/
protected AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
if (!mAccessibilityManager.isEnabled() || mNativeObj == 0 || !mFrameInfoInitialized) {
return null;
}
int rootId = nativeGetRootId(mNativeObj);
if (virtualViewId == View.NO_ID) {
virtualViewId = rootId;
}
if (mAccessibilityFocusId == View.NO_ID) {
mAccessibilityFocusId = rootId;
}
final AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(mView);
info.setPackageName(mContentViewCore.getContext().getPackageName());
info.setSource(mView, virtualViewId);
if (nativePopulateAccessibilityNodeInfo(mNativeObj, info, virtualViewId)) {
return info;
} else {
return null;
}
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(mContext.getPackageName());
info.setSource(NumberPicker.this, virtualViewId);
info.setParent(NumberPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(NumberPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
info.setVisibleToUser(isVisibleToUser(boundsInParent));
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info)
{
super.onInitializeAccessibilityNodeInfo(host, info);
@Nullable final Package viewPackage = PromptView.this.getClass().getPackage();
if (viewPackage != null)
{
info.setPackageName(viewPackage.getName());
}
info.setSource(host);
info.setClickable(true);
info.setEnabled(true);
info.setChecked(false);
info.setFocusable(true);
info.setFocused(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
{
info.setLabelFor(mPromptOptions.getTargetView());
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
info.setDismissable(true);
}
info.setContentDescription(mPromptOptions.getContentDescription());
info.setText(mPromptOptions.getContentDescription());
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this, virtualViewId);
info.setParent(NumberPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(NumberPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
// info.setVisibleToUser(isVisibleToUser(boundsInParent));
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this, virtualViewId);
info.setParent(NumberPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(NumberPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
info.setVisibleToUser(getVisibility() == View.VISIBLE);
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
private void addToastMsgToRoot(CharSequence tokenMSG) {
AccessibilityNodeInfo node = AccessibilityNodeInfo.obtain();
node.setText(tokenMSG);
node.setClassName(Toast.class.getName());
node.setPackageName("com.android.settings");
setField("mSealed", true, node);
this.children.add(new UiAutomationElement(node, this.children.size()));
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(TextPicker.this, virtualViewId);
info.setParent(TextPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(TextPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
// TODO info.setVisibleToUser(isVisibleToUser(boundsInParent));
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (TextPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
/**
* @see AccessibilityNodeProvider#createAccessibilityNodeInfo(int)
*/
protected AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
if (!mAccessibilityManager.isEnabled() || mNativeObj == 0) {
return null;
}
int rootId = nativeGetRootId(mNativeObj);
if (virtualViewId == View.NO_ID) {
return createNodeForHost(rootId);
}
if (!isFrameInfoInitialized()) {
return null;
}
final AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(mView);
info.setPackageName(mContentViewCore.getContext().getPackageName());
info.setSource(mView, virtualViewId);
if (virtualViewId == rootId) {
info.setParent(mView);
}
if (nativePopulateAccessibilityNodeInfo(mNativeObj, info, virtualViewId)) {
return info;
} else {
info.recycle();
return null;
}
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForVirtualButton(int virtualViewId,
String text, int left, int top, int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(Button.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this, virtualViewId);
info.setParent(NumberPicker.this);
info.setText(text);
info.setClickable(true);
info.setLongClickable(true);
info.setEnabled(NumberPicker.this.isEnabled());
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
// TODO info.setVisibleToUser(isVisibleToUser(boundsInParent));
info.setBoundsInParent(boundsInParent);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == virtualViewId) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
info.addAction(AccessibilityNodeInfo.ACTION_CLICK);
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top,
int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(NumberPicker.class.getName());
info.setPackageName(mContext.getPackageName());
info.setSource(NumberPicker.this);
if (hasVirtualDecrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT);
}
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (hasVirtualIncrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT);
}
info.setParent((View) getParentForAccessibility());
info.setEnabled(NumberPicker.this.isEnabled());
info.setScrollable(true);
final float applicationScale =
getContext().getResources().getCompatibilityInfo().applicationScale;
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
boundsInParent.scale(applicationScale);
info.setBoundsInParent(boundsInParent);
info.setVisibleToUser(isVisibleToUser());
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
boundsInScreen.scale(applicationScale);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
if (getWrapSelectorWheel() || getValue() < getMaxValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
if (getWrapSelectorWheel() || getValue() > getMinValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top,
int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(NumberPicker.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this);
if (hasVirtualDecrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT);
}
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (hasVirtualIncrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT);
}
info.setParent((View) getParentForAccessibility());
info.setEnabled(NumberPicker.this.isEnabled());
info.setScrollable(true);
// TODO: Figure out compat implementation for this final float
// final float applicationScale =
// getContext().getResources().getCompatibilityInfo().applicationScale;
//
// Rect boundsInParent = mTempRect;
// boundsInParent.set(left, top, right, bottom);
// boundsInParent.scale(applicationScale);
// info.setBoundsInParent(boundsInParent);
//
// info.setVisibleToUser(isVisibleToUser());
//
// Rect boundsInScreen = boundsInParent;
// int[] locationOnScreen = mTempArray;
// getLocationOnScreen(locationOnScreen);
// boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
// boundsInScreen.scale(applicationScale);
// info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
if (getWrapSelectorWheel() || getValue() < getMaxValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
if (getWrapSelectorWheel() || getValue() > getMinValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top,
int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(NumberPicker.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this);
if (hasVirtualDecrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT);
}
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (hasVirtualIncrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT);
}
info.setParent((View) getParentForAccessibility());
info.setEnabled(NumberPicker.this.isEnabled());
info.setScrollable(true);
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
info.setBoundsInParent(boundsInParent);
info.setVisibleToUser(getVisibility() == View.VISIBLE);
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
info.setBoundsInScreen(boundsInScreen);
if (mAccessibilityFocusedView != View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
if (getWrapSelectorWheel() || getValue() < getMaxValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
if (getWrapSelectorWheel() || getValue() > getMinValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top,
int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(TextPicker.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(TextPicker.this);
if (hasVirtualDecrementButton()) {
info.addChild(TextPicker.this, VIRTUAL_VIEW_ID_DECREMENT);
}
info.addChild(TextPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (hasVirtualIncrementButton()) {
info.addChild(TextPicker.this, VIRTUAL_VIEW_ID_INCREMENT);
}
info.setParent((View) getParentForAccessibility());
info.setEnabled(TextPicker.this.isEnabled());
info.setScrollable(true);
/** TODO: Figure out compat implementation for this
final float applicationScale =
getContext().getResources().getCompatibilityInfo().applicationScale;
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
boundsInParent.scale(applicationScale);
info.setBoundsInParent(boundsInParent);
info.setVisibleToUser(isVisibleToUser());
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
boundsInScreen.scale(applicationScale);
info.setBoundsInScreen(boundsInScreen);
*/
if (mAccessibilityFocusedView != View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (TextPicker.this.isEnabled()) {
if (getWrapSelectorWheel() || getValue() < getMaxValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
if (getWrapSelectorWheel() || getValue() > getMinValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
return info;
}
private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top,
int right, int bottom) {
AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain();
info.setClassName(NumberPicker.class.getName());
info.setPackageName(getContext().getPackageName());
info.setSource(NumberPicker.this);
if (hasVirtualDecrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT);
}
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT);
if (hasVirtualIncrementButton()) {
info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT);
}
info.setParent((View) getParentForAccessibility());
info.setEnabled(NumberPicker.this.isEnabled());
info.setScrollable(true);
/** TODO: Figure out compat implementation for this
final float applicationScale =
getContext().getResources().getCompatibilityInfo().applicationScale;
Rect boundsInParent = mTempRect;
boundsInParent.set(left, top, right, bottom);
boundsInParent.scale(applicationScale);
info.setBoundsInParent(boundsInParent);
info.setVisibleToUser(isVisibleToUser());
Rect boundsInScreen = boundsInParent;
int[] locationOnScreen = mTempArray;
getLocationOnScreen(locationOnScreen);
boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]);
boundsInScreen.scale(applicationScale);
info.setBoundsInScreen(boundsInScreen);
*/
if (mAccessibilityFocusedView != View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
}
if (mAccessibilityFocusedView == View.NO_ID) {
info.addAction(AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS);
}
if (NumberPicker.this.isEnabled()) {
if (getWrapSelectorWheel() || getValue() < getMaxValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
}
if (getWrapSelectorWheel() || getValue() > getMinValue()) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
}
return info;
}