Most visited

Recently visited

Added in API level 24

Window.OnFrameMetricsAvailableListener

public static interface Window.OnFrameMetricsAvailableListener

android.view.Window.OnFrameMetricsAvailableListener


针对需要窗口呈现的每个帧的帧定时信息的客户端的回调。

Summary

Public methods

abstract void onFrameMetricsAvailable(Window window, FrameMetrics frameMetrics, int dropCountSinceLastInvocation)

当信息可用于先前渲染的帧时调用。

Public methods

onFrameMetricsAvailable

Added in API level 24
void onFrameMetricsAvailable (Window window, 
                FrameMetrics frameMetrics, 
                int dropCountSinceLastInvocation)

当信息可用于先前渲染的帧时调用。 如果此回调执行时间过长,报告可能会丢失,因为报告生产者无法等待消费者完成。 我们强烈建议客户副本中FrameMetrics通过传递FrameMetrics(FrameMetrics)在此方法中,并推迟额外的计算或存储到另一个线程,以避免不必要下降的报告。

Parameters
window Window: The Window on which the frame was displayed.
frameMetrics FrameMetrics: the available metrics. This object is reused on every call and thus this reference is not valid outside the scope of this method.
dropCountSinceLastInvocation int: the number of reports dropped since the last time this callback was invoked.

Hooray!