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 |
|---|
ConstraintLayoutStatistics(ConstraintLayout constraintLayout)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 |
clone()Create a copy of the statistics |
void |
detach()Detach from a ConstraintLayout |
long |
getValue(int type)get the value of a statistic |
void |
logSummary(String tag)Log a summary of the statistics |
void |
logSummary(String tag, ConstraintLayoutStatistics prev)log a summary of the stats compared to another statics |
void |
reset()Clear the current metrics |
Constants
Public constructors
ConstraintLayoutStatistics
public ConstraintLayoutStatistics(ConstraintLayout constraintLayout)
Measure performance information about ConstraintLayout
| Parameters | |
|---|---|
ConstraintLayout constraintLayout |
ConstraintLayoutStatistics
public ConstraintLayoutStatistics(ConstraintLayoutStatistics copy)
Copy a layout Stats useful for comparing two stats
| Parameters | |
|---|---|
ConstraintLayoutStatistics copy |
Public methods
attach
public void attach(ConstraintLayout constraintLayout)
Attach to a ConstraintLayout to gather statistics on its layout performance
| Parameters | |
|---|---|
ConstraintLayout constraintLayout |
clone
public ConstraintLayoutStatistics clone()
Create a copy of the statistics
| Returns | |
|---|---|
ConstraintLayoutStatistics |
a copy |
getValue
public long getValue(int type)
get the value of a statistic
| Parameters | |
|---|---|
int type |
| Returns | |
|---|---|
long |
logSummary
public void logSummary(String tag)
Log a summary of the statistics
| Parameters | |
|---|---|
String tag |
logSummary
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 |