diff options
| author | 2015-06-01 11:26:32 -0700 | |
|---|---|---|
| committer | 2015-06-01 11:26:32 -0700 | |
| commit | e9fd6d29f49e11bdce4d4cb865c04e24fb7b55fa (patch) | |
| tree | 3ae224805c15fe20d5a789306b07bd6fd6b11696 | |
| parent | 16224288791dd3f122931504e624637fdcc70903 (diff) | |
Don't take the compatibility path for non-primary ActionModes
Action modes that are not of type PRIMARY currently go through some
compatibility gymnastics so that the non-typed startActionModeForChild
ViewParent method has an opportunity to process them. Unfortunately, a
lot of apps in the wild use AppCompat, which intercepts these and
presents its own contextual action bar UI.
In practice this now means that the new floating toolbars for
TextViews and similar components don't show up in the majority of
existing apps. While this may be more correct from a compatibility
standpoint, it presents a poor user experience.
Only take the compatibility code path that calls through the older,
untyped startActionModeForChild method when the type is PRIMARY. The
tradeoff is that apps that previously would use parent views to modify
a text selection action mode will now no longer be able to do so.
Change-Id: I8c892a7a84ec36e6a484a5cba0c95281ea6beafb
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index a7e739d9c248..506cd37f8fc0 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -793,7 +793,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager @Override public ActionMode startActionModeForChild( View originalView, ActionMode.Callback callback, int type) { - if ((mGroupFlags & FLAG_START_ACTION_MODE_FOR_CHILD_IS_NOT_TYPED) == 0) { + if ((mGroupFlags & FLAG_START_ACTION_MODE_FOR_CHILD_IS_NOT_TYPED) == 0 + && type == ActionMode.TYPE_PRIMARY) { ActionMode mode; try { mGroupFlags |= FLAG_START_ACTION_MODE_FOR_CHILD_IS_TYPED; |