diff options
author | Alan Viverette <alanv@google.com> | 2013-08-21 17:55:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-21 17:55:49 +0000 |
commit | 5feb0ad1d234cc7146286e96f96ae162bd628363 (patch) | |
tree | 54fca65dfd13f14b4bd1b99f4c5905f2c5eeb545 | |
parent | f6121f38c0b8640cafb7ff8cbaa8f3413f085b78 (diff) | |
parent | 058ac7cfe5bb7b9ecc411b94622ac3f31a7fa25e (diff) | |
download | frameworks_base-5feb0ad1d234cc7146286e96f96ae162bd628363.zip frameworks_base-5feb0ad1d234cc7146286e96f96ae162bd628363.tar.gz frameworks_base-5feb0ad1d234cc7146286e96f96ae162bd628363.tar.bz2 |
Merge "Use MULTI_LINE and OPENS_POPUP accessibility properties" into klp-dev
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); + } + } } |