Skip to content

API | ResponsiveColumn

Jarek Toro edited this page Oct 20, 2016 · 2 revisions

Class ResponsiveColumn

Crucial Component this object holds all the magic to the responsiveness

Constructors

  • ResponsiveColumn(int xs, int sm, int md, int lg)
    • Creates the responsive rules giving it the sizes for Mobile(xs) Tablet(sm) Computer(md) WideScreen(lg)
  • ResponsiveColumn(int xs, int sm, int md)
    • Creates the responsive rules giving it the sizes for Mobile(xs) Tablet(sm) Computer(md) WideScreen(md)
  • ResponsiveColumn(int xs, int sm)
    • Creates the responsive rules giving it the sizes for Mobile(xs) Tablet(sm) Computer(sm) WideScreen(sm)
  • ResponsiveColumn(int xs)
    • Creates the responsive rules giving it the sizes for Mobile(xs) Tablet(xs) Computer(xs) WideScreen(xs)

Methods

  • addRule(DisplaySize displaySize, int width)
    • Adds a responsiveRule to the Column -i.e 1-12- for a given DisplaySize .
  • setVisibilityRules(boolean xs, boolean sm, boolean md, boolean lg) -Sets the visibility rules for each DisplaySize true = visible false = hidden_
  • setVisibility(DisplaySize displaySize, boolean isVisible) -Sets the visibility rules for the DisplaySize true = visible false = hidden_
  • isVisibleForDisplaySize(DisplaySize displaySize) -> boolean -Returns true if the current visibility rules will make the ResponsiveColumn hidden on that DisplaySize
  • setOffset(DisplaySize displaySize, int offset) -Adds an offset to the column pushing it to the left by the offset for the specific DisplaySize
  • centerContent(boolean shouldCenter) -Centers the Component it holds
  • setComponent(Component component) -Does what the method says, Same as Panel.setContent() -This is under consideration if the method should be setContent instead. Feel free to comment on this
  • getComponent() -> Component -returns its Component

Convenience Methods

  • withDisplayRules(int xs, int sm, int md, int lg) -> ResponsiveColumn
    • When called it applies the DisplayRules then returns self.
  • withVisibilityRules(boolean xs, boolean sm, boolean md, boolean lg) -> ResponsiveColumn
    • When called it applies the VisibilityRules then returns self.
  • withComponent(Component component) -> ResponsiveColumn
    • When called it sets the Component then returns self.
  • withCenteredComponent(Component component) -> ResponsiveColumn
    • When called it sets the Component then centers it then returns self.
Clone this wiki locally