API Reference 0.7.1rikulo_layoutLinearLayout

LinearLayout class

The linear layout. It arranges the children of the associated view in a single column or a single row. The direction is controlled by LayoutDeclaration.orient. If not specified, it is default to horizontal.

class LinearLayout extends AbstractLayout {
 int measureWidth(MeasureContext mctx, View view)
 => _linearHandler(view).measureWidth(mctx, view);
 int measureHeight(MeasureContext mctx, View view)
 => _linearHandler(view).measureHeight(mctx, view);

 void doLayout_(MeasureContext mctx, View view, List<View> children)
 => _linearHandler(view).doLayout(mctx, view, children);
}

Extends

Layout > AbstractLayout > LinearLayout

Properties

final bool isFlex #

inherited from AbstractLayout

Default: false.

bool get isFlex => false;

final bool isProfileInherited #

inherited from AbstractLayout

Default: true.

bool get isProfileInherited => true;

Methods

void doLayout(MeasureContext mctx, View view) #

inherited from AbstractLayout

Handles the layout of the given view.

docs inherited from Layout
void doLayout(MeasureContext mctx, View view) {
 if (view.firstChild != null) {
   final AnchorRelation ar = new AnchorRelation(view);
   for (final View child in ar.indeps) {
     mctx.preLayout(child);
     //unlike View.onLayout_, the layout shall invoke mctx.preLayout
   }

   //1) layout independents
   doLayout_(mctx, view, ar.indeps);

   //2) do anchored
   ar.layoutAnchored(mctx);

   //3) pass control to children
   for (final View child in view.children) {
     if (child.visible)
       child.doLayout_(mctx); //no matter shallLayout_(child)
   }
 }
}

void doLayout_(MeasureContext mctx, View view, List<View> children) #

Arranges the layout of non-anchored views. Instead of overriding doLayout, it is simpler to override this method.

docs inherited from AbstractLayout
void doLayout_(MeasureContext mctx, View view, List<View> children)
=> _linearHandler(view).doLayout(mctx, view, children);

int measureHeight(MeasureContext mctx, View view) #

Measure the height of the given view.

docs inherited from Layout
int measureHeight(MeasureContext mctx, View view)
=> _linearHandler(view).measureHeight(mctx, view);

int measureWidth(MeasureContext mctx, View view) #

Measure the width of the given view.

docs inherited from Layout
int measureWidth(MeasureContext mctx, View view)
=> _linearHandler(view).measureWidth(mctx, view);