SliceMetrics

public class SliceMetrics
extends Object

java.lang.Object
   ↳ android.app.slice.SliceMetrics


Metrics interface for slices. This is called by SliceView, so Slice developers should not need to reference this class.

See also:

Summary

Public constructors

SliceMetrics(Context context, Uri uri)

An object to be used throughout the life of a slice to register events.

Public methods

void logHidden()

To be called whenever the slice becomes invisible to the user.

void logTouch(int actionType, Uri subSlice)

To be called whenever the user invokes a discrete action via a slice.

void logVisible()

To be called whenever the slice becomes visible to the user.

Inherited methods

Public constructors

SliceMetrics

SliceMetrics (Context context, 
                Uri uri)

An object to be used throughout the life of a slice to register events.

Parameters
context Context

This value must never be null.

uri Uri

This value must never be null.

Public methods

logHidden

void logHidden ()

To be called whenever the slice becomes invisible to the user.

logTouch

void logTouch (int actionType, 
                Uri subSlice)

To be called whenever the user invokes a discrete action via a slice.

Use this for discrete events like a tap or the end of a drag, not for a continuous streams of events, such as the motion during a gesture.

Parameters
actionType int: The type of the event.

subSlice Uri: The URI of the sub-slice that is the subject of the interaction.

This value must never be null.

See also:

logVisible

void logVisible ()

To be called whenever the slice becomes visible to the user.