Add content description setter to RemoteViews

bug:5480389

Change-Id: I66616f379a244ba7f3552d766f3aaa77f207550a
This commit is contained in:
Svetoslav Ganov
2011-10-18 17:47:04 -07:00
parent 29a15a237a
commit e261e283ea
3 changed files with 12 additions and 0 deletions

View 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);

View 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;
}

View File

@@ -1545,6 +1545,16 @@ public class RemoteViews implements Parcelable, Filter {
addAction(new ReflectionAction(viewId, methodName, ReflectionAction.INTENT, value));
}
/**
* 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.