Skip to content

API | ResponsiveRow

Jarek Toro edited this page Nov 8, 2016 · 7 revisions

Class ResponsiveRow

Crucial Component works similar to a HorizontalLayout. Its job is to hold all of the ResponsiveColumn objects

Methods

  • setMargin(boolean margin)

    • Adds a margin around the ResponsiveColumns On All DisplaySizes.
  • setMarginSmall(boolean margin)

    • Adds a smaller margin around the ResponsiveColumns On All DisplaySizes.
    • Very useful when nesting Rows inside ResponsiveColumns.
    • .setMargin(true) is required for this method to work
  • setMargin(MarginSize marginSize, ResponsiveColumn.DisplaySize displaySize, boolean margin)

    • Adds a margin based on size around the ResponsiveColumns On the given DisplaySize.
    • The boolean margin can be set to false, which hides the margin on that displaySize.
  • setSpacing(boolean margin)

    • Adds a smaller margin in between (both Vertical and Horizontal) the ResponsiveColumns.
  • setVerticalSpacing(boolean margin)

    • Adds a smaller margin in between (Vertical Only) the ResponsiveColumns .
  • setHorizontalSpacing(boolean margin)

    • Adds a smaller margin in between (Horizontal Only) the ResponsiveColumns .
  • setDefaultComponentAlignment(Alignment alignment)

    • Sets the alignment of the ResponsiveColumns it holds.
    • Currently only applies to all ResponsiveColumns, You can't separate alignment for individual ResponsiveColumns
  • addColumn(ResponsiveColumn column)

    • Adds a column to the layout similar to .addComponent(Component component).
  • addComponent(Component component)

    • Adds a component directly to the row.
    • Useful when you add many components of various sizes because they will automagically wrap around depending on the screen size.
    • Components added this way will be treated as first class citizens and get spacing and margin as if it was a ResponsiveColumn.

Convenience Methods

  • withAlignment(Alignment alignment) -> ResponsiveRow
    • When called it applies the Alignment to itself then returns itself back.
  • withMargin(boolean margin) -> ResponsiveRow
    • When called it applies the Margin to itself then returns itself back.
  • withSmallMargin(boolean margin) -> ResponsiveRow
    • When called it applies the Small Margin to itself then returns itself back.
    • Unlike calling .setMarginSmall() you do not need to call setMargin(true) first.
  • withSpacing(boolean spacing) -> ResponsiveRow
    • When called it applies the Spacing to itself then returns itself back.
  • withVerticalSpacing(boolean spacing) -> ResponsiveRow
    • When called it applies the Vertical Spacing to itself then returns itself back.
  • withHorizontalSpacing(boolean spacing) -> ResponsiveRow
    • When called it applies the Horizontal Spacing to itself then returns itself back.
  • addColumn() -> ResponsiveColumn
    • Convenience Method that add a ResponsiveColumn to itself then returns the ResponsiveColumn.
    • In effect it does this for you
        ResponsiveColumn column = new ResponsiveColumn();
        self.addColumn(ResponsiveColumn);
        return column;
Clone this wiki locally