Sony Addon SDK public class

SmartWatchWidgetImage

This project is no longer being supported and will not get any further updates.
extends java.lang.Object
  1. java.lang.Object
  2. com.sonyericsson.extras.liveware.extension.util.widget.SmartWatchWidgetImage

Class Overview

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.

Summary

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.

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

public SmartWatchWidgetImage(Context context)

Initiate the SmartWatch widget image.

Parameters
context The context.

Public Methods

public SmartWatchWidgetImage setText(java.lang.String text)

Set custom text. Typically used when only a text shall be displayed, and no specific layout is needed.

Parameters
text The text.
Returns

this.

public SmartWatchWidgetImage setIconByResourceId(int iconId)

Set widget icon by id.

Parameters
iconId The icon id.
Returns

this.

public SmartWatchWidgetImage setIconByUri(java.lang.String iconUri)

Set widget icon by uri.

Parameters
iconUri The icon uri.
Returns

this.

public SmartWatchWidgetImage setInnerLayoutResourceId(int layoutId)

Set custom layout inside the widget frame. Not needed setText is used.

Parameters
layoutId The layout id.
Returns

this.

public SmartWatchWidgetImage setBadgeCount(int number)

Set number to be shown in upper left badge. Badge is not visible if number < 1.

Parameters
number The number.
Returns

this.

public Bitmap getBitmap()

Get the bitmap.

Returns

The bitmap.

Protected Methods

protected void applyInnerLayout(LinearLayout innerLayout)

Get bitmap inside the frame. Example: ((TextView)innerLayout.findViewById(R.id.my_custom_widget_city)). setText("Paris");

Parameters
innerLayout