AppWidgetEvent


class AppWidgetEvent : Parcelable
kotlin.Any
   ↳ android.appwidget.AppWidgetEvent

An immutable class that describes the event data for an app widget interaction event.

Summary

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Int

The app widget ID of the widget that generated this event.

IntArray?

This returns the set of View IDs of the views which have been clicked during the event time range.

Instant

Describes the end of the time range that this event contains data for.

Rect?

This rect with describes the global coordinates of the widget at the end of the event time range.

IntArray?

This returns the set of View IDs of the views which have been scrolled during the event time range.

Instant

Describes the start of the time range that this event contains data for.

Duration

Describes the total duration of time during which the widget was visible.

String

Returns a string representation of the object.

Unit
writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AppWidgetEvent!>

Parcelable.

Public methods

describeContents

fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getAppWidgetId

fun getAppWidgetId(): Int

The app widget ID of the widget that generated this event.

getClickedIds

fun getClickedIds(): IntArray?

This returns the set of View IDs of the views which have been clicked during the event time range. Use android.widget.RemoteViews#setAppWidgetEventTag(int, int) to set a custom integer tag on a view for reporting clicks. If the tag is set, it will be used here instead of the View ID.

Return
IntArray? This value may be null.

getEnd

fun getEnd(): Instant

Describes the end of the time range that this event contains data for.

Return
Instant This value cannot be null.

getPosition

fun getPosition(): Rect?

This rect with describes the global coordinates of the widget at the end of the event time range.

Return
Rect? This value may be null.

getScrolledIds

fun getScrolledIds(): IntArray?

This returns the set of View IDs of the views which have been scrolled during the event time range. Use android.widget.RemoteViews#setAppWidgetEventTag(int, int) to set a custom integer tag on a view for reporting scrolls. If the tag is set, it will be used here instead of the View ID.

Return
IntArray? This value may be null.

getStart

fun getStart(): Instant

Describes the start of the time range that this event contains data for.

Return
Instant This value cannot be null.

getVisibleDuration

fun getVisibleDuration(): Duration

Describes the total duration of time during which the widget was visible. This may be different than the event time range (between getStart() and getEnd() if the widget was hidden and shown multiple times during the event time range.

Return
Duration This value cannot be null.

toString

fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

fun writeToParcel(
    out: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:
out Parcel: This value cannot be null.

Properties

CREATOR

static val CREATOR: Parcelable.Creator<AppWidgetEvent!>

Parcelable.Creator that instantiates AppWidgetEvent objects