Direct
public class Direct
Direct resolution engine This walks through the graph of dependencies and infer final position. This allows us to skip the linear solver in many situations, as well as skipping intermediate measure passes. Widgets are solved independently in horizontal and vertical. Any widgets not fully resolved will be computed later on by the linear solver.
Summary
Public constructors |
|---|
Direct() |
Public methods |
|
|---|---|
static String |
ls(int level)Small utility function to indent logs depending on the level |
static boolean |
solveChain(Try to directly resolve the chain |
static void |
solvingPass(Walk the dependency graph and solves it. |
Public constructors
Public methods
ls
public static String ls(int level)
Small utility function to indent logs depending on the level
| Returns | |
|---|---|
String |
a formatted string for the indentation |
solveChain
public static boolean solveChain(
ConstraintWidgetContainer container,
LinearSystem system,
int orientation,
int offset,
ChainHead chainHead,
boolean isChainSpread,
boolean isChainSpreadInside,
boolean isChainPacked
)
Try to directly resolve the chain
| Returns | |
|---|---|
boolean |
true if fully resolved |
solvingPass
public static void solvingPass(
ConstraintWidgetContainer layout,
BasicMeasure.Measurer measurer
)
Walk the dependency graph and solves it.
| Parameters | |
|---|---|
ConstraintWidgetContainer layout |
the container we want to optimize |
BasicMeasure.Measurer measurer |
the measurer used to measure the widget |