OSDN Git Service

Add content description setter to RemoteViews
authorSvetoslav Ganov <svetoslavganov@google.com>
Wed, 19 Oct 2011 00:47:04 +0000 (17:47 -0700)
committerSvetoslav Ganov <svetoslavganov@google.com>
Wed, 19 Oct 2011 01:01:47 +0000 (18:01 -0700)
bug:5480389

Change-Id: I66616f379a244ba7f3552d766f3aaa77f207550a

api/current.txt
core/java/android/view/View.java
core/java/android/widget/RemoteViews.java

index ffa46ec..b30f7a6 100644 (file)
@@ -26782,6 +26782,7 @@ package android.widget {
     method public void setChar(int, java.lang.String, char);
     method public void setCharSequence(int, java.lang.String, java.lang.CharSequence);
     method public void setChronometer(int, long, java.lang.String, boolean);
+    method public void setContentDescription(int, java.lang.CharSequence);
     method public void setDisplayedChild(int, int);
     method public void setDouble(int, java.lang.String, double);
     method public void setEmptyView(int, int);
index a2f9b36..fea79d5 100644 (file)
@@ -4219,6 +4219,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
      *
      * @attr ref android.R.styleable#View_contentDescription
      */
+    @RemotableViewMethod
     public void setContentDescription(CharSequence contentDescription) {
         mContentDescription = contentDescription;
     }
index 9cf2718..1592061 100644 (file)
@@ -1546,6 +1546,16 @@ public class RemoteViews implements Parcelable, Filter {
     }
 
     /**
+     * Equivalent to calling View.setContentDescription
+     *
+     * @param viewId The id of the view whose content description should change
+     * @param contentDescription The new content description for the view
+     */
+    public void setContentDescription(int viewId, CharSequence contentDescription) {
+        setCharSequence(viewId, "setContentDescription", contentDescription);
+    }
+
+    /**
      * Inflates the view hierarchy represented by this object and applies
      * all of the actions.
      *