Added in API level 28
Deprecated in API level 35

SliceMetrics


open class SliceMetrics
kotlin.Any
   ↳ android.app.slice.SliceMetrics

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

Summary

Public constructors
SliceMetrics(context: Context, uri: Uri)

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

Public methods
open Unit

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

open Unit
logTouch(actionType: Int, subSlice: Uri)

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

open Unit

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

Public constructors

SliceMetrics

Added in API level 28
SliceMetrics(
    context: Context,
    uri: Uri)

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

Parameters
context Context: This value cannot be null.
uri Uri: This value cannot be null.

Public methods

logHidden

Added in API level 28
open fun logHidden(): Unit

Deprecated: Deprecated in Java.

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

logTouch

Added in API level 28
open fun logTouch(
    actionType: Int,
    subSlice: Uri
): Unit

Deprecated: Deprecated in Java.

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 cannot be null.

See Also

    logVisible

    Added in API level 28
    open fun logVisible(): Unit

    Deprecated: Deprecated in Java.

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