Actionpublic class Action extends Object An action that can be shown on a details page. It contains one or two lines
of text and an optional image. |
Fields Summary |
---|
private long | mId | private android.graphics.drawable.Drawable | mIcon | private CharSequence | mLabel1 | private CharSequence | mLabel2 |
Constructors Summary |
---|
public Action(long id)Constructor for an Action.
this(id, "");
| public Action(long id, CharSequence label)Constructor for an Action.
this(id, label, null);
| public Action(long id, CharSequence label1, CharSequence label2)Constructor for an Action.
this(id, label1, label2, null);
| public Action(long id, CharSequence label1, CharSequence label2, android.graphics.drawable.Drawable icon)Constructor for an Action.
setId(id);
setLabel1(label1);
setLabel2(label2);
setIcon(icon);
|
Methods Summary |
---|
public final android.graphics.drawable.Drawable | getIcon()Returns the icon drawable for this Action.
return mIcon;
| public final long | getId()Returns the id for this Action.
return mId;
| public final java.lang.CharSequence | getLabel1()Returns the first line label for this Action.
return mLabel1;
| public final java.lang.CharSequence | getLabel2()Returns the second line label for this Action.
return mLabel2;
| public final void | setIcon(android.graphics.drawable.Drawable icon)Set the icon drawable for this Action.
mIcon = icon;
| public final void | setId(long id)Set id for this Action.
mId = id;
| public final void | setLabel1(java.lang.CharSequence label)Set the first line label for this Action.
mLabel1 = label;
| public final void | setLabel2(java.lang.CharSequence label)Set the second line label for this Action.
mLabel2 = label;
| public java.lang.String | toString()
StringBuilder sb = new StringBuilder();
if (!TextUtils.isEmpty(mLabel1)) {
sb.append(mLabel1);
}
if (!TextUtils.isEmpty(mLabel2)) {
if (!TextUtils.isEmpty(mLabel1)) {
sb.append(" ");
}
sb.append(mLabel2);
}
if (mIcon != null && sb.length() == 0) {
sb.append("(action icon)");
}
return sb.toString();
|
|