LayoutKit icon indicating copy to clipboard operation
LayoutKit copied to clipboard

Added AutoRotateStackLayout

Open nbadakh opened this issue 6 years ago • 7 comments

- The AutoRotateStackLayout displays its contents along the horizontal axis by default. - If the contents do not fit along the horizontal axis, the AutoRotateStackLayout switchs to displaying them along the vertical axis. - The AutoRotateStackLayout uses to StackLayouts to implement its behavior. - Also added AutoRotateStackViewController to demonstrate the use of AutoRotateStackLayout. TODO: Add tests.

nbadakh avatar Jul 24 '18 15:07 nbadakh

- Attached screenshots:

landscape_horizontal_axis

portrait_vertical_axis

nbadakh avatar Jul 24 '18 15:07 nbadakh

This would be the first none essential layout that would go into the library. Wouldn't it make more sense to split it in an sub project?

FabianTerhorst avatar Jul 24 '18 15:07 FabianTerhorst

Added unit tests

nbadakh avatar Jul 26 '18 15:07 nbadakh

@FabianTerhorst you bring up a good point, thank you, we'll consider it.

staguer avatar Jul 27 '18 21:07 staguer

Fixed merge conflicts.

nbadakh avatar Jul 30 '18 12:07 nbadakh

@FabianTerhorst We're considering generalizing this component a bit. It would take an array of layout options and at measurement time it would pick the first one that fits. Sounds like a useful primitive for apps that need to support Dynamic Type and languages with long words. What do you think?

staguer avatar Oct 01 '18 19:10 staguer

Sounds good.

FabianTerhorst avatar Oct 01 '18 19:10 FabianTerhorst