Hi Koders!
I just noticed there is a missing Dynamic Arrangement component, so I wanted to create a one! I just tried to implement arrangement’s properties, and wanted to keep it simple as much as possible so here it is!
It is also open source so feel free about editing, sharing, or integrating to Kodular (maybe ), I won’t force you to credit me if you are going to use this extension’s source code.
I made that with AppyBuilder’s Code Editor because Kodular IDE currently having problems.
It has 12 methods:
Some Block Details
-
CreateArrangement
Creates a dynamic arrangement in an arrangement which is already exists.-
arrangement
- The arrangement component which new arrangement will placed in. -
orientation
- Specify if you want an Horizontal arrangement or Vertical one.
(Use with HorizontalOrientation or VerticalOrientation block.) -
scrollable
- Set ittrue
if you want a scrollable arrangement.
-
-
SetAlign
-
component
- The arrangement which you want to use with this method. -
orientation
- Sets the vertical or horizontal alignment for contents of the arrangement.
(For example, if you want to change its Horizontal Alignment, use HorizontalOrientation block.)
-
-
SetVisibility
-
component
- The arrangement which you want to use with this method. -
visibility
- Specifies whether the component should be visible on the screen. Value is true if the component is showing and false if hidden.
-
-
SetWidth
-
component
- The arrangement which you want to use with this method. -
width
- Specifies the component’s horizontal width, measured in pixels. Currently, it is not possible to set as Fill Parent, you can set the Screen’s width as solution.
-
-
SetHeight
-
component
- The arrangement which you want to use with this method. -
height
- Specifies the component’s vertical height, measured in pixels. Currently, it is not possible to set as Fill Parent, you can set the Screen’s height as solution.
-
Other methods are getter for these ones, so I didn’t write them here.
An example usage about using this extension along with other dynamic components:
I didn’t add ID property, so this extension won’t store created dynamic arrangements, so you need to store created arrangements in the variables.
Note for using it in App Inventor
This extension works for App Inventor too, however as App Inventor doesn’t have built-in dynamic components to create dynamic label, image, textbox etc. This extension will only create blank arrangements without additional Dynamic Components extension.
Also, you can hide the created arrangement if you want to delete it from view.
WARNING
This extension only creates dynamic arrangements, to create all dynamic components in one extension, see my new Dynamic Components extension which supports dynamic arrangements too.
Source Code
Download:
com.appybuilder.ycdemirbas.DynamicArrangements (4).aix (10.9 KB)