ConstraintLayoutStatistics


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

Public constructors

Measure performance information about ConstraintLayout

Copy a layout Stats useful for comparing two stats

Public functions

Unit
attach(constraintLayout: ConstraintLayout!)

Attach to a ConstraintLayout to gather statistics on its layout performance

ConstraintLayoutStatistics!

Create a copy of the statistics

Unit

Detach from a ConstraintLayout

Long
getValue(type: Int)

get the value of a statistic

Unit

Log a summary of the statistics

Unit

log a summary of the stats compared to another statics

Unit

Clear the current metrics

Constants

DURATION_OF_CHILD_MEASURES

Added in 2.2.0
const val DURATION_OF_CHILD_MEASURES = 5: Int

DURATION_OF_LAYOUT

Added in 2.2.0
const val DURATION_OF_LAYOUT = 7: Int

DURATION_OF_MEASURES

Added in 2.2.0
const val DURATION_OF_MEASURES = 6: Int

NUMBER_OF_CHILD_MEASURES

Added in 2.2.0
const val NUMBER_OF_CHILD_MEASURES = 4: Int

NUMBER_OF_CHILD_VIEWS

Added in 2.2.0
const val NUMBER_OF_CHILD_VIEWS = 3: Int

NUMBER_OF_EQUATIONS

Added in 2.2.0
const val NUMBER_OF_EQUATIONS = 9: Int

NUMBER_OF_LAYOUTS

Added in 2.2.0
const val NUMBER_OF_LAYOUTS = 1: Int

NUMBER_OF_ON_MEASURES

Added in 2.2.0
const val NUMBER_OF_ON_MEASURES = 2: Int

NUMBER_OF_SIMPLE_EQUATIONS

Added in 2.2.0
const val NUMBER_OF_SIMPLE_EQUATIONS = 10: Int

NUMBER_OF_VARIABLES

Added in 2.2.0
const val NUMBER_OF_VARIABLES = 8: Int

Public constructors

ConstraintLayoutStatistics

Added in 2.2.0
ConstraintLayoutStatistics(constraintLayout: ConstraintLayout!)

Measure performance information about ConstraintLayout

Parameters
constraintLayout: ConstraintLayout!

ConstraintLayoutStatistics

Added in 2.2.0
ConstraintLayoutStatistics(copy: ConstraintLayoutStatistics!)

Copy a layout Stats useful for comparing two stats

Parameters
copy: ConstraintLayoutStatistics!

Public functions

attach

Added in 2.2.0
fun attach(constraintLayout: ConstraintLayout!): Unit

Attach to a ConstraintLayout to gather statistics on its layout performance

Parameters
constraintLayout: ConstraintLayout!

clone

Added in 2.2.0
fun clone(): ConstraintLayoutStatistics!

Create a copy of the statistics

Returns
ConstraintLayoutStatistics!

a copy

detach

Added in 2.2.0
fun detach(): Unit

Detach from a ConstraintLayout

getValue

Added in 2.2.0
fun getValue(type: Int): Long

get the value of a statistic

Parameters
type: Int
Returns
Long

logSummary

Added in 2.2.0
fun logSummary(tag: String!): Unit

Log a summary of the statistics

Parameters
tag: String!

logSummary

Added in 2.2.0
fun logSummary(tag: String!, prev: ConstraintLayoutStatistics!): Unit

log a summary of the stats compared to another statics

Parameters
tag: String!

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

prev: ConstraintLayoutStatistics!

the previous stats to compare to

reset

Added in 2.2.0
fun reset(): Unit

Clear the current metrics