Public Member Functions | |
ImageWidget (String tag) | |
void | setPath (String path) |
Sets the path of image. More... | |
void | setSize (int width, int height) |
Sets the width and height of image in widget. More... | |
void | setPosition (int left, int top) |
Sets the top-left position of the image in the widget. More... | |
void | setRect (int left, int top, int width, int height) |
Sets the top-left position and dimensions of image in widget. More... | |
String | getPath () |
int | getLeft () |
int | getTop () |
int | getWidth () |
int | getHeight () |
String | getTag () |
Returns tag of the widget given in constructor. More... | |
void | setOnSidebarActionListener (OnSidebarActionListener listener) |
Register a callback to be invoked when an action happens on this widget. More... | |
void | invokeOnSidebarActionCallback (int action, Bundle extras) |
This method shouldn't be called manually! More... | |
Static Public Attributes | |
static final int | EVENT_IMAGE_CLICKED = 1 |
Event ID: image was clicked. More... | |
static final int | SIZE_FIT = -1 |
Use this size to stretch the width or height to fit the widget window. More... | |
static final int | SIZE_DEFAULT = -2 |
Use this size to keep the width or height of bitmap. More... | |
ImageWidget | ( | String | tag | ) |
References ImageWidget.SIZE_DEFAULT.
int getHeight | ( | ) |
int getLeft | ( | ) |
String getPath | ( | ) |
|
inherited |
Returns tag of the widget given in constructor.
Referenced by Sidebar.setWidget().
int getTop | ( | ) |
int getWidth | ( | ) |
|
inherited |
This method shouldn't be called manually!
References OnSidebarActionListener.onSidebarAction().
|
inherited |
Register a callback to be invoked when an action happens on this widget.
listener | the callback that will run |
void setPath | ( | String | path | ) |
Sets the path of image.
path | full (absolute) path to the image |
Example:
imageWidget.setPath(Environment.getExternalStorageDirectory() + "/image.bmp");
void setPosition | ( | int | left, |
int | top | ||
) |
Sets the top-left position of the image in the widget.
left | |
top |
void setRect | ( | int | left, |
int | top, | ||
int | width, | ||
int | height | ||
) |
Sets the top-left position and dimensions of image in widget.
For width and height constants SIZE_FIT and SIZE_DEFAULT can be used.
left | |
top | |
width | |
height |
void setSize | ( | int | width, |
int | height | ||
) |
Sets the width and height of image in widget.
Constants SIZE_FIT and SIZE_DEFAULT can be used.
width | |
height |
|
static |
Event ID: image was clicked.
|
static |
Use this size to keep the width or height of bitmap.
Referenced by ImageWidget.ImageWidget().
|
static |
Use this size to stretch the width or height to fit the widget window.