SmartEyeglass SDK public class

SmartEyeglassWidgetImage

extends java.lang.Object
  1. java.lang.Object
  2. com.sony.smarteyeglass.extension.util.SmartEyeglassWidgetImage

Class Overview

Defines a widget bitmap that conforms to SmartEyeglass standards for the top-level menu. Use to define a "card", the screen in the top menu that starts your app.

Summary

Fields
protected final Context mContext
protected final BitmapFactory.Options mBitmapOptions
protected final int mInnerWidth
protected final int mInnerHeight
Public Constructors
SmartEyeglassWidgetImage(Context context)

Initializes the SmartEyeglass widget image with a frame size suitable for the SmartEyeglass display.

Public Methods
static int getSupportedWidgetHeight(Context context)

Retrieves the widget frame height for the SmartEyeglass.

static int getSupportedWidgetWidth(Context context)

Retrieves the widget frame width for the SmartEyeglass.

SmartEyeglassWidgetImage setText(java.lang.String text)

Sets a custom text.

SmartEyeglassWidgetImage setIconByResourceId(int iconId)

Sets the widget icon using a resource ID.

SmartEyeglassWidgetImage setIconByUri(java.lang.String iconUri)

Sets the widget icon using a URI.

SmartEyeglassWidgetImage setInnerLayoutResourceId(int layoutId)

Creates an instance of this class that displays a custom layout inside the widget frame.

Bitmap getBitmap()

Retrieves the bitmap for this widget.

Protected Methods
void applyInnerLayout(LinearLayout innerLayout)

Retrieves the bitmap inside the widget frame.

Fields

protected final Context mContext

protected final BitmapFactory.Options mBitmapOptions

protected final int mInnerWidth

protected final int mInnerHeight

Public Constructors

public SmartEyeglassWidgetImage(Context context)

Initializes the SmartEyeglass widget image with a frame size suitable for the SmartEyeglass display.

Parameters
context The context.

Public Methods

public static int getSupportedWidgetHeight(Context context)

Retrieves the widget frame height for the SmartEyeglass.

Parameters
context The context.
Returns

The height in pixels.

public static int getSupportedWidgetWidth(Context context)

Retrieves the widget frame width for the SmartEyeglass.

Parameters
context The context.
Returns

The width in pixels.

public SmartEyeglassWidgetImage setText(java.lang.String text)

Sets a custom text. Typically used for a card that shows only text, where no specific layout is needed.

Parameters
text The display text.
Returns

this.

public SmartEyeglassWidgetImage setIconByResourceId(int iconId)

Sets the widget icon using a resource ID.

Parameters
iconId The resource ID of the icon to display.
Returns

this.

public SmartEyeglassWidgetImage setIconByUri(java.lang.String iconUri)

Sets the widget icon using a URI.

Parameters
iconUri The URI of the icon.
Returns

this.

public SmartEyeglassWidgetImage setInnerLayoutResourceId(int layoutId)

Creates an instance of this class that displays a custom layout inside the widget frame.

Parameters
layoutId The resource ID of the layout.
Returns

this.

public Bitmap getBitmap()

Retrieves the bitmap for this widget.

Returns

The bitmap object.

Protected Methods

protected void applyInnerLayout(LinearLayout innerLayout)

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

Parameters
innerLayout