| java.lang.Object | ||
| ↳ | com.neomades.ui.View | |
| ↳ | com.neomades.ui.ImageButton | |
Control that displays an Image as a Button.
ImageButton could have many images for different states of a
Button.
By default, the following properties are applied to a new ImageButton:
MATCH_PARENT.MATCH_CONTENT.HCENTER|VCENTER.| XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Attribute Name | Related Method | Description | |||||||||
| image | setImage(Image) | Res.image.XXXX or a color | |||||||||
| imageDisabled | setImageDisabled(Image) | Res.image.XXXX or a color | |||||||||
| imageFocused | setImageFocused(int) | Res.image.XXXX or a color | |||||||||
| imagePressed | setImagePressed(int) | Res.image.XXXX or a color | |||||||||
|
[Expand]
Inherited XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.neomades.ui.Alignment
| |||||||||||
From interface
com.neomades.ui.StretchMode
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ImageButton()
Creates a new Button.
| |||||||||||
|
ImageButton(Image img)
Creates a new Button with only an image.
| |||||||||||
|
ImageButton(int resId)
Creates a new Button with only an image.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
setImage(int resId)
Sets the image.
| ||||||||||
| void |
setImage(Image image)
Sets the image.
| ||||||||||
| void |
setImageDisabled(int image)
Sets the disabled image.
| ||||||||||
| void | setImageDisabled(Image image) | ||||||||||
| void | setImageFocused(Image image) | ||||||||||
| void |
setImageFocused(int image)
Sets the focused image.
| ||||||||||
| void | setImagePressed(Image image) | ||||||||||
| void |
setImagePressed(int image)
Sets the pressed image.
| ||||||||||
| void |
setImageScaleType(int scaleType)
Set the scale type for the image contained into this button.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
From class
java.lang.Object
| |||||||||||
Creates a new Button.
Creates a new Button with only an image.
| img | the image to display |
|---|
Creates a new Button with only an image.
| resId | the image to display |
|---|
Sets the image.
| resId | the image to show |
|---|
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
Sets the image.
| image | the image to show. |
|---|
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
Sets the disabled image.
| image | the image to show when the button is disabled |
|---|
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
Sets the focused image.
| image | the image to show when the button is focused |
|---|
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
Sets the pressed image.
| image | the image to show when the button is pressed |
|---|
| CrossThreadException | if this method call is done in the wrong Thread. |
|---|---|
| CrossThreadException | if the method is called from outside the UI-Thread |