summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewParent.java
diff options
context:
space:
mode:
authorClara Bayarri <clarabayarri@google.com>2015-03-02 19:42:48 +0000
committerClara Bayarri <clarabayarri@google.com>2015-03-13 10:51:51 +0000
commit4423d91de5300d3fd318bf5bc2d4d7e5bb856abf (patch)
treef62a9d12f773379d306278c6cb003f545df8138c /core/java/android/view/ViewParent.java
parent993d128477bf7c9a55a015bd9dc5e4fafddf9a14 (diff)
Add a type parameter to startActionMode() calls.
This requires adding a new method to View and Window.Callback to pass down the type as a parameter. For compatibility purposes, the new method implementations keep the type and call the old method, in case clients have subclassed it. Change-Id: If5d857f131e33be8cc6a8814f2e9c4e85ad2da25
Diffstat (limited to 'core/java/android/view/ViewParent.java')
-rw-r--r--core/java/android/view/ViewParent.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index 035871d87671..15b86d1245b2 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -190,7 +190,8 @@ public interface ViewParent {
public void createContextMenu(ContextMenu menu);
/**
- * Start an action mode for the specified view.
+ * Start an action mode for the specified view with the default type
+ * {@link ActionMode#TYPE_PRIMARY}.
*
* <p>In most cases, a subclass does not need to override this. However, if the
* subclass is added directly to the window manager (for example,
@@ -200,17 +201,35 @@ public interface ViewParent {
* @param originalView The source view where the action mode was first invoked
* @param callback The callback that will handle lifecycle events for the action mode
* @return The new action mode if it was started, null otherwise
+ *
+ * @see #startActionModeForChild(View, android.view.ActionMode.Callback, int)
*/
public ActionMode startActionModeForChild(View originalView, ActionMode.Callback callback);
/**
+ * Start an action mode of a specific type for the specified view.
+ *
+ * <p>In most cases, a subclass does not need to override this. However, if the
+ * subclass is added directly to the window manager (for example,
+ * {@link ViewManager#addView(View, android.view.ViewGroup.LayoutParams)})
+ * then it should override this and start the action mode.</p>
+ *
+ * @param originalView The source view where the action mode was first invoked
+ * @param callback The callback that will handle lifecycle events for the action mode
+ * @param type One of {@link ActionMode#TYPE_PRIMARY} or {@link ActionMode#TYPE_FLOATING}.
+ * @return The new action mode if it was started, null otherwise
+ */
+ public ActionMode startActionModeForChild(
+ View originalView, ActionMode.Callback callback, int type);
+
+ /**
* This method is called on the parent when a child's drawable state
* has changed.
*
* @param child The child whose drawable state has changed.
*/
public void childDrawableStateChanged(View child);
-
+
/**
* Called when a child does not want this parent and its ancestors to
* intercept touch events with