Constants | ||
---|---|---|
int | REQUIRED_API_VERSION |
Inherited Constants | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
From class WidgetExtension
|
Fields | ||
---|---|---|
protected static final java.lang.String[] | EVENT_PROJECTION | |
protected final int | mNoEventsTextResourceId | |
protected final int | mDefaultSourceIconResourceId | |
protected final Handler | mHandler | |
protected final java.lang.String | mExtensionKey | |
protected NotificationWidgetEvent | mLastEvent |
Inherited Fields | |||||||||
---|---|---|---|---|---|---|---|---|---|
From class WidgetExtension
|
Public Constructors | |
---|---|
NotificationWidgetExtension(Context context, Handler handler, java.lang.String hostAppPackageName, java.lang.String extensionKey, int noEventsTextResourceid, int defaultSourceIconResourceId)
Create notification extension widget. |
Public Methods | |
---|---|
static int |
getSupportedWidgetWidth(Context context)
Get supported widget width. |
static int |
getSupportedWidgetHeight(Context context)
Get supported widget height. |
void | onScheduledRefresh() |
void |
onStartRefresh()
Start refreshing the widget. |
void |
onStopRefresh()
Stop refreshing the widget. |
void |
onTouch(int type, int x, int y)
The widget has been touched. |
Bitmap |
getBitmap(NotificationWidgetEvent event)
Create a bitmap from notification event. |
Protected Methods | |
---|---|
void |
updateWidget(boolean checkEvent)
Update widget. |
NotificationWidgetEvent |
getEvent()
Get the widget event to show. |
Cursor |
getEventCursor()
Get the event cursor for most relevant event, defined as: the event with the lowest PUBLISHED_TIME with PUBLISHED_TIME > current time. |
int |
getCount()
Get the number of new events. |
java.lang.String |
getSourceIconUri(long sourceId)
Get the source icon uri for a source id. |
java.lang.String |
getNoEventsText()
Get the text to show in the no events widget. |
Inherited Methods | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class WidgetExtension
|
Constant Value: 1 (0x00000001)
Create notification extension widget.
context | The context. |
---|---|
handler | The handler. |
hostAppPackageName | The host app package name for this widget. |
extensionKey | The extension key. |
noEventsTextResourceid | The resource id of the string to show in the no events widget. |
defaultSourceIconResourceId | The resource if of the image to show when there are no events |
Get supported widget width.
context | The context. |
---|
the width.
Get supported widget height.
context | The context. |
---|
the height.
Start refreshing the widget. The widget is now visible.
Stop refreshing the widget. The widget is no longer visible.
The widget has been touched.
type | The type of touch event. |
---|---|
x | The x position of the touch event. |
y | The y position of the touch event. |
Create a bitmap from notification event.
event | The event or null if no events. |
---|
the bitmap to send to the host application.
Update widget.
checkEvent | True if we shall check if the event is new before we update. False to disable check. |
---|
Get the widget event to show.
The widget event to show.
Get the event cursor for most relevant event, defined as: the event with the lowest PUBLISHED_TIME with PUBLISHED_TIME > current time. If no such event choose the event with highest PUBLISHED_TIME.
The event cursor for the event
Get the number of new events.
The number of new events.
Get the source icon uri for a source id.
sourceId | The source id. |
---|
The source icon uri.
Get the text to show in the no events widget.
The text to show in the no events widget.
The widget extension handles a widget on an accessory.