diff options
author | Alan Viverette <alanv@google.com> | 2013-08-19 16:44:30 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2013-08-19 16:44:30 -0700 |
commit | 058ac7cfe5bb7b9ecc411b94622ac3f31a7fa25e (patch) | |
tree | 2beac08ca64a883f9a0740e360b1172da5d3c754 | |
parent | b6c38e9de1a2824ce599d7074fa4a226926177c1 (diff) | |
download | frameworks_base-058ac7cfe5bb7b9ecc411b94622ac3f31a7fa25e.zip frameworks_base-058ac7cfe5bb7b9ecc411b94622ac3f31a7fa25e.tar.gz frameworks_base-058ac7cfe5bb7b9ecc411b94622ac3f31a7fa25e.tar.bz2 |
Use MULTI_LINE and OPENS_POPUP accessibility properties
BUG: 10391326
Change-Id: Ib2deeeef401802b6dde646e14ee5367141469a58
5 files changed, 33 insertions, 0 deletions
diff --git a/core/java/android/widget/ActivityChooserView.java b/core/java/android/widget/ActivityChooserView.java index 2037c3a..c070ee4 100644 --- a/core/java/android/widget/ActivityChooserView.java +++ b/core/java/android/widget/ActivityChooserView.java @@ -33,6 +33,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.ActivityChooserModel.ActivityChooserModelClient; /** @@ -229,6 +230,13 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod mExpandActivityOverflowButton = (FrameLayout) findViewById(R.id.expand_activities_button); mExpandActivityOverflowButton.setOnClickListener(mCallbacks); + mExpandActivityOverflowButton.setAccessibilityDelegate(new AccessibilityDelegate() { + @Override + public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(host, info); + info.setOpensPopup(true); + } + }); mExpandActivityOverflowButtonImage = (ImageView) mExpandActivityOverflowButton.findViewById(R.id.image); mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable); diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index eec15a9..b707cef 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -645,6 +645,10 @@ public class Spinner extends AbsSpinner implements OnClickListener { public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(Spinner.class.getName()); + + if (mAdapter != null) { + info.setOpensPopup(true); + } } /** diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index a315546..d5fc21c 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -8173,6 +8173,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener info.addAction(AccessibilityNodeInfo.ACTION_CUT); } } + + if (!isSingleLine()) { + info.setMultiLine(true); + } } @Override diff --git a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java index 863d8cc..30f9793 100644 --- a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java +++ b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java @@ -29,6 +29,7 @@ import android.view.SoundEffectConstants; import android.view.View; import android.view.ViewConfiguration; import android.view.View.MeasureSpec; +import android.view.accessibility.AccessibilityNodeInfo; import android.view.ViewGroup; import android.widget.ImageButton; @@ -594,6 +595,12 @@ public class ActionMenuPresenter extends BaseMenuPresenter } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.setOpensPopup(true); + } } private class OverflowPopup extends MenuPopupHelper { diff --git a/core/java/com/android/internal/view/menu/ListMenuItemView.java b/core/java/com/android/internal/view/menu/ListMenuItemView.java index df579c6..85d9cbd 100644 --- a/core/java/com/android/internal/view/menu/ListMenuItemView.java +++ b/core/java/com/android/internal/view/menu/ListMenuItemView.java @@ -23,6 +23,7 @@ import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; @@ -269,4 +270,13 @@ public class ListMenuItemView extends LinearLayout implements MenuView.ItemView } return mInflater; } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + + if (mItemData != null && mItemData.hasSubMenu()) { + info.setOpensPopup(true); + } + } } |