ConstraintLayoutStatistics

public class ConstraintLayoutStatistics


This provide metrics of the complexity of the layout that is being solved. The intent is for developers using the too to track the evolution of their UI Typically the developer will monitor the computations on every callback of mConstraintLayout.addOnLayoutChangeListener(this::callback);

Summary

Constants

static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int

Public constructors

Measure performance information about ConstraintLayout

Copy a layout Stats useful for comparing two stats

Public methods

void
attach(ConstraintLayout constraintLayout)

Attach to a ConstraintLayout to gather statistics on its layout performance

ConstraintLayoutStatistics

Create a copy of the statistics

void

Detach from a ConstraintLayout

long
getValue(int type)

get the value of a statistic

void

Log a summary of the statistics

void

log a summary of the stats compared to another statics

void

Clear the current metrics

Constants

DURATION_OF_CHILD_MEASURES

Added in 2.2.0-alpha13
public static final int DURATION_OF_CHILD_MEASURES = 5

DURATION_OF_LAYOUT

Added in 2.2.0-alpha13
public static final int DURATION_OF_LAYOUT = 7

DURATION_OF_MEASURES

Added in 2.2.0-alpha13
public static final int DURATION_OF_MEASURES = 6

NUMBER_OF_CHILD_MEASURES

Added in 2.2.0-alpha13
public static final int NUMBER_OF_CHILD_MEASURES = 4

NUMBER_OF_CHILD_VIEWS

Added in 2.2.0-alpha13
public static final int NUMBER_OF_CHILD_VIEWS = 3

NUMBER_OF_EQUATIONS

Added in 2.2.0-alpha13
public static final int NUMBER_OF_EQUATIONS = 9

NUMBER_OF_LAYOUTS

Added in 2.2.0-alpha13
public static final int NUMBER_OF_LAYOUTS = 1

NUMBER_OF_ON_MEASURES

Added in 2.2.0-alpha13
public static final int NUMBER_OF_ON_MEASURES = 2

NUMBER_OF_SIMPLE_EQUATIONS

Added in 2.2.0-alpha13
public static final int NUMBER_OF_SIMPLE_EQUATIONS = 10

NUMBER_OF_VARIABLES

Added in 2.2.0-alpha13
public static final int NUMBER_OF_VARIABLES = 8

Public constructors

ConstraintLayoutStatistics

Added in 2.2.0-alpha13
public ConstraintLayoutStatistics(ConstraintLayout constraintLayout)

Measure performance information about ConstraintLayout

Parameters
ConstraintLayout constraintLayout

ConstraintLayoutStatistics

Added in 2.2.0-alpha13
public ConstraintLayoutStatistics(ConstraintLayoutStatistics copy)

Copy a layout Stats useful for comparing two stats

Parameters
ConstraintLayoutStatistics copy

Public methods

attach

Added in 2.2.0-alpha13
public void attach(ConstraintLayout constraintLayout)

Attach to a ConstraintLayout to gather statistics on its layout performance

Parameters
ConstraintLayout constraintLayout

clone

Added in 2.2.0-alpha13
public ConstraintLayoutStatistics clone()

Create a copy of the statistics

detach

Added in 2.2.0-alpha13
public void detach()

Detach from a ConstraintLayout

getValue

Added in 2.2.0-alpha13
public long getValue(int type)

get the value of a statistic

Parameters
int type
Returns
long

logSummary

Added in 2.2.0-alpha13
public void logSummary(String tag)

Log a summary of the statistics

Parameters
String tag

logSummary

Added in 2.2.0-alpha13
public void logSummary(String tag, ConstraintLayoutStatistics prev)

log a summary of the stats compared to another statics

Parameters
String tag

used in Log.v(tag, ...)

ConstraintLayoutStatistics prev

the previous stats to compare to

reset

Added in 2.2.0-alpha13
public void reset()

Clear the current metrics