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

Public methods

static String
ls(int level)

Small utility function to indent logs depending on the level

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

static void

Walk the dependency graph and solves it.

Public constructors

Direct

Added in 1.1.0-alpha13
public Direct()

Public methods

ls

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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

Added in 1.1.0-alpha13
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