public class ButtonItem extends AbstractItem implements View.OnClickListener
ButtonBarItem
. This item
will not be bound by the adapter, and must be a child of ButtonBarItem
.Modifier and Type | Class and Description |
---|---|
static interface |
ButtonItem.OnClickListener |
ItemHierarchy.Observer
Constructor and Description |
---|
ButtonItem() |
ButtonItem(Context context,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
protected Button |
createButton(ViewGroup parent)
Create a button according to this button item.
|
int |
getCount() |
int |
getLayoutResource()
Get the Android resource ID for locating the layout for this item.
|
CharSequence |
getText() |
int |
getTheme() |
boolean |
isEnabled() |
void |
onBindView(View view)
Do not use this since ButtonItem is not directly part of a list.
|
void |
onClick(View v)
Called when a view has been clicked.
|
void |
setEnabled(boolean enabled) |
void |
setOnClickListener(ButtonItem.OnClickListener listener) |
void |
setText(CharSequence text) |
void |
setTheme(int theme)
The theme to use for this button.
|
findItemById, getItemAt
getId, notifyChanged, registerObserver, setId, unregisterObserver
public ButtonItem()
public ButtonItem(Context context, AttributeSet attrs)
public void setOnClickListener(ButtonItem.OnClickListener listener)
public void setText(CharSequence text)
public CharSequence getText()
public void setTheme(int theme)
android:buttonStyle
will be set in
the theme to change the style applied by the button.theme
- Resource ID of the themepublic int getTheme()
public void setEnabled(boolean enabled)
public int getCount()
getCount
in interface ItemHierarchy
getCount
in class AbstractItem
public boolean isEnabled()
public int getLayoutResource()
IItem
getLayoutResource
in interface IItem
IItem.onBindView(android.view.View)
.public final void onBindView(View view)
onBindView
in interface IItem
view
- A view inflated from IItem.getLayoutResource()
, which should be updated to
display data from this item. This view may be recycled from other items with the
same layout resource.protected Button createButton(ViewGroup parent)
parent
- The parent of the button, used to retrieve the theme and context for this
button.public void onClick(View v)
View.OnClickListener
onClick
in interface View.OnClickListener
v
- The view that was clicked.