JankStats.OnFrameListener


fun interface JankStats.OnFrameListener


This interface should be implemented to receive per-frame callbacks with jank data.

Internally, the FrameData objected passed to OnFrameListener.onFrame is reused and populated with new data on every frame. This means that listeners implementing OnFrameListener cannot depend on the data received in that structure over time and should consider the FrameData object obsolete when control returns from the listener. Clients wishing to retain data from this call should copy the data elsewhere before returning.

Summary

Public functions

Unit
onFrame(volatileFrameData: FrameData)

The implementation of this method will be called on every frame when an OnFrameListener is set on this JankStats object.

Public functions

onFrame

Added in 1.0.0-beta01
fun onFrame(volatileFrameData: FrameData): Unit

The implementation of this method will be called on every frame when an OnFrameListener is set on this JankStats object.

The FrameData object will be modified internally after returning from the listener; any data that needs to be retained should be copied before returning.

Parameters
volatileFrameData: FrameData

The data for the most recent frame.