summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2011-10-18 17:47:04 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2011-10-18 18:01:47 -0700
commite261e283eaedd38235fc93b2a5c35758c613b10c (patch)
tree2442090bcf449b07514f7d078c43774dd4f0ee5d
parent29a15a237aa9a0ee0af594fbf23cf999415f2390 (diff)
Add content description setter to RemoteViews
bug:5480389 Change-Id: I66616f379a244ba7f3552d766f3aaa77f207550a
-rw-r--r--api/current.txt1
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/android/widget/RemoteViews.java10
3 files changed, 12 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index ffa46ec1cd41..b30f7a6d76a1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a2f9b360b2b4..fea79d55f0bc 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -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;
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 9cf27181d3ae..1592061906ab 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -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.
*