Fields | ||
---|---|---|
protected final Context | mContext | |
protected final BitmapFactory.Options | mBitmapOptions | |
protected final int | mOuterWidth | |
protected final int | mOuterHeight | |
protected final int | mInnerWidth | |
protected final int | mInnerHeight |
Public Constructors | |
---|---|
SmartWatchWidgetImage(Context context)
Initiate the SmartWatch widget image. |
Public Methods | |
---|---|
SmartWatchWidgetImage |
setText(java.lang.String text)
Set custom text. |
SmartWatchWidgetImage |
setIconByResourceId(int iconId)
Set widget icon by id. |
SmartWatchWidgetImage |
setIconByUri(java.lang.String iconUri)
Set widget icon by uri. |
SmartWatchWidgetImage |
setInnerLayoutResourceId(int layoutId)
Set custom layout inside the widget frame. |
SmartWatchWidgetImage |
setBadgeCount(int number)
Set number to be shown in upper left badge. |
Bitmap |
getBitmap()
Get the bitmap. |
Protected Methods | |
---|---|
void |
applyInnerLayout(LinearLayout innerLayout)
Get bitmap inside the frame. |
Initiate the SmartWatch widget image.
context | The context. |
---|
Set custom text. Typically used when only a text shall be displayed, and no specific layout is needed.
text | The text. |
---|
this.
Set widget icon by id.
iconId | The icon id. |
---|
this.
Set widget icon by uri.
iconUri | The icon uri. |
---|
this.
Set custom layout inside the widget frame. Not needed setText is used.
layoutId | The layout id. |
---|
this.
Set number to be shown in upper left badge. Badge is not visible if number < 1.
number | The number. |
---|
this.
Get the bitmap.
The bitmap.
Get bitmap inside the frame. Example: ((TextView)innerLayout.findViewById(R.id.my_custom_widget_city)). setText("Paris");
innerLayout |
---|
The SmartWatchWidgetImage class is used to generate widget bitmap which follows official SmartWatch layout of where e.g. frame and icon shall be located. The layout inside the frame can be customized by applying setting inner layout resource id.