diff options
| author | 2011-07-14 22:37:06 -0700 | |
|---|---|---|
| committer | 2011-07-18 16:32:00 -0700 | |
| commit | f178737f823cf22d9a07df6f51071b7189a95e7e (patch) | |
| tree | 5f6f1ed041368405e44b3748dda328e763a1d2d5 | |
| parent | c27cc947e42b1effb5f6d18e0d6a8a1055f271d9 (diff) | |
Fix bug 5031652 - offer a way to associate metadata with an ActionMode
Change-Id: Ic9d453b5c58eea922ec65423801e008d953bb25b
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/view/ActionMode.java | 30 | 
2 files changed, 32 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index e4a1bc6b2b58..93b935e5aa01 100644 --- a/api/current.txt +++ b/api/current.txt @@ -20931,11 +20931,13 @@ package android.view {      method public abstract android.view.Menu getMenu();      method public abstract android.view.MenuInflater getMenuInflater();      method public abstract java.lang.CharSequence getSubtitle(); +    method public java.lang.Object getTag();      method public abstract java.lang.CharSequence getTitle();      method public abstract void invalidate();      method public abstract void setCustomView(android.view.View);      method public abstract void setSubtitle(java.lang.CharSequence);      method public abstract void setSubtitle(int); +    method public void setTag(java.lang.Object);      method public abstract void setTitle(java.lang.CharSequence);      method public abstract void setTitle(int);    } diff --git a/core/java/android/view/ActionMode.java b/core/java/android/view/ActionMode.java index bfafa987ceda..e9549834b215 100644 --- a/core/java/android/view/ActionMode.java +++ b/core/java/android/view/ActionMode.java @@ -23,6 +23,36 @@ package android.view;   * Examples of good action modes include selection modes, search, content editing, etc.   */  public abstract class ActionMode { +    private Object mTag; + +    /** +     * Set a tag object associated with this ActionMode. +     * +     * <p>Like the tag available to views, this allows applications to associate arbitrary +     * data with an ActionMode for later reference. +     * +     * @param tag Tag to associate with this ActionMode +     * +     * @see #getTag() +     */ +    public void setTag(Object tag) { +        mTag = tag; +    } + +    /** +     * Retrieve the tag object associated with this ActionMode. +     * +     * <p>Like the tag available to views, this allows applications to associate arbitrary +     * data with an ActionMode for later reference. +     * +     * @return Tag associated with this ActionMode +     * +     * @see #setTag(Object) +     */ +    public Object getTag() { +        return mTag; +    } +      /**       * Set the title of the action mode. This method will have no visible effect if       * a custom view has been set.  |