diff options
author | Guang Zhu <guangzhu@google.com> | 2012-05-14 19:37:18 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-14 19:37:18 -0700 |
commit | 9a19d16a1a44b8f394f93e116adb48024148f8ef (patch) | |
tree | 77394b5b2ac25e244d6451012aa1ef53af7492e9 /core/java/android/widget/NumberPicker.java | |
parent | 183dc8e254472484252afa550f2771786ded4580 (diff) | |
parent | 58b0dcde83354bd1ae9091a7cbc7f207fb29960a (diff) | |
download | frameworks_base-9a19d16a1a44b8f394f93e116adb48024148f8ef.zip frameworks_base-9a19d16a1a44b8f394f93e116adb48024148f8ef.tar.gz frameworks_base-9a19d16a1a44b8f394f93e116adb48024148f8ef.tar.bz2 |
am 58b0dcde: am 0d607fbe: accessibility bug fix in NumberPicker
* commit '58b0dcde83354bd1ae9091a7cbc7f207fb29960a':
accessibility bug fix in NumberPicker
Diffstat (limited to 'core/java/android/widget/NumberPicker.java')
-rw-r--r-- | core/java/android/widget/NumberPicker.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index 6ff924b..7c809b3 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -2239,20 +2239,17 @@ public class NumberPicker extends LinearLayout { info.setPackageName(mContext.getPackageName()); info.setSource(NumberPicker.this, virtualViewId); info.setParent(NumberPicker.this); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT); - info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT); 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.offsetTo(0, 0); boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]); info.setBoundsInScreen(boundsInScreen); return info; @@ -2261,19 +2258,22 @@ public class NumberPicker extends LinearLayout { private AccessibilityNodeInfo createAccessibilityNodeInfoForNumberPicker(int left, int top, int right, int bottom) { AccessibilityNodeInfo info = AccessibilityNodeInfo.obtain(); - info.setClassName(Button.class.getName()); + info.setClassName(NumberPicker.class.getName()); info.setPackageName(mContext.getPackageName()); info.setSource(NumberPicker.this); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_DECREMENT); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INPUT); + info.addChild(NumberPicker.this, VIRTUAL_VIEW_ID_INCREMENT); info.setParent((View) getParent()); info.setEnabled(NumberPicker.this.isEnabled()); info.setScrollable(true); Rect boundsInParent = mTempRect; boundsInParent.set(left, top, right, bottom); info.setBoundsInParent(boundsInParent); + info.setVisibleToUser(isVisibleToUser()); Rect boundsInScreen = boundsInParent; int[] locationOnScreen = mTempArray; getLocationOnScreen(locationOnScreen); - boundsInScreen.offsetTo(0, 0); boundsInScreen.offset(locationOnScreen[0], locationOnScreen[1]); info.setBoundsInScreen(boundsInScreen); return info; |