Skip to main content
Version: 4.60

picker

Allows the user to pick one or multiple files from the system storage. These files can be images, videos, files or audio files. Since the picker layer itself has no visible appearance, it is usually placed inside a container layer.

Field Configurations

KeyTypeDescriptionDefault Value
"allowCapture"BooleanIndicates if capturing images/videos with the camera is allowed.true
"allowMultipleSelection"BooleanIndicates if multiple items can be picked. If false, previously picked items will be overridden.false
"desiredHeight"NumberAndroid only. Determines the preferred height of the image (Only with desiredWidth)null
"desiredWidth"NumberAndroid only. Determines the preferred width of the image (Only with desiredHeight)null
"enableCrop"BooleanIndicates if cropping images with the camera/gallery is allowed.true
"fileDataKey"Stringundefinednull
"fileNameKey"StringOptional name of key to send attachment as base64 encoded String.null
"fileTypeKey"StringOptional type name of the key to send the mime type of the base64 encoded attachment.null
"maxDimension"NumberDetermines the maximum edge length of the image.null
"mediaType"MediaTypeMedia type to pick.null
"mediaTypes"MediaTypeMedia types to pick, if multiple types are allowed.null
"onPicked"StringEvent that should be fired when media was picked.null
"previewKey"StringOptionalKey used to send video preview images.null
"progressBarBackground"ColorThe background color of the progress bar when a video is reduced in size.null
"progressBarColor"ColorThe color of the progress bar when a video is reduced in size.null
"quality"QualityDetermines the desired quality of a video.null

Inherited

From Form Layer

Form Layer

Field Configurations

KeyTypeDescriptionDefault Value
"form"StringName of the form e.g. used to access the value of the form outside of its view.null
"formDataKey"StringDatakey used to access the value of the form layer.null
"onChanged"ArrayActions to execute when the form value is changed.null
"settingsDataKey"StringIf set, the value of the form layer will be written into the _settings table. DEPRECATED Use onChanged to save values in the database.null
"validationErrorMessage"StringMessage to display in case the input is invalid.null
"validationExpression"StringRegex to use in the validateForm action.null
"valueActionIndex"StringIndex of the value action.null
"valueActions"ArrayActions to be executed when a specified value is set e.g. hiding a layer when a checkbox is selected.null
From Base Layer

Base Layer

Field Configurations

KeyTypeDescriptionDefault Value
"_value"Value[PREVIEW] Dynamic value of the layer.null
"accessibilityAppendState"StringDefines this layer appends its state to the accessibility text.null
"accessibilityText"StringText for accessibility navigation. Can be translated.null
"actions"ActionListList of actions, which will be executed when the layer is tapped.null
"borderColor"ColorThe color of the border in hex color value.null
"borderRadius"UnitSizeThe radius applies to all corners; with a borderWidth of 0 the border is not drawn and radius is set anyway.0
"borderWidth"UnitSizeThe width of the border.0
"bottomLeftRadius"UnitSizeRadius for the bottom left corner.0
"bottomRightRadius"UnitSizeRadius for the bottom right corner.0
"classes"ArrayList of classes for layer styles.null
"conditions"ConditionsList of conditions to alter the layer state.null
"constraints"ConstraintsA list of constraints defining the position of the layer in a layout.null
"consumesKeyboard"BooleanThis layer will be used to shrink, if a keyboard is shown.null
"dataKey"StringName for assigning data to this layer.null
"focusColor"ColorThe highlight color of this layer when it is focused. Mainly used on TV. If no color is provided, the pressedColor will be used.null
"hidden"BooleanIndicates whether the layer is hidden. Default: false.false
"isAccessibilityElement"StringDefines if this layer is important for accessibility navigation. The default depends on the layer type.null
"layerRotation"NumberThe layer is rotated by the specified degree.0
"name"StringUnique name in the layout. Used for alignment or actions.null
"opacity"NumberThe opacity of the layer.1
"overInsetBottom"BooleanDetermines if this layer ignores the save space at the bottom of the device.false
"overInsetTop"BooleanDetermines if this layer ignores the save space at the top of the device.false
"pressedColor"ColorThe highlight color of this layer when it is pressed. Mainly used on TV. If no color is provided, the focusColor will be used.null
"safeArea"SafeAreaTypeObjectDetermines the safe area behaviour.null
"shadowElevation"NumberThe elevation of this layer for casting shadows.0
"state"StringThe state the layer will use as default."default"
"states"LayerStatesA list of named states that affect the appearance of the layer.null
"topLeftRadius"UnitSizeRadius for the top left corner.0
"topRightRadius"UnitSizeRadius for the top right corner.0
"touchFeedback"TouchFeedbackDetermines if the layer should show a touch feedback if touched."visible"
"trackingKey"StringDefines a key for a scroll event.null
"type"LayerTypeThe type of the layernull
"value"Value(Initial) value of the layer.null

Examples

Example 1: Creating a picker supporting multiple images

Goal: Create a picker that allows the user to pick multiple images.

To achieve this the following code can be used:

{
"type": "container",
"borderRadius": "25pt",
"borderWidth": "1pt",
"borderColor": "f3f3f3",
"constraints": [
{
"type": "pos",
"x": "50%",
"y": "35%",
"anchor": "c"
},
{
"type": "size",
"height": "60pt",
"width": "200pt"
}
],
"children": [
{
"type": "color",
"value": "#34a7c9",
"classes": [
"fullSize"
]
},
{
"type": "text",
"value": "Pick images",
"fontSize": "20pt",
"scaleType": "alignCenter",
"classes": [
"fullSize"
]
},
{
"type": "picker",
"mediaType": "image",
"allowMultipleSelection": true,
"classes": [
"fullSize"
]
}
]
}

The mediaType field of the picker layer defines what type of files can be picked. The purpose of the container layer in this example is to viusalize the picker layer.

Result:

Screencapture of the app showing the results of the sample code from Example 1.
A picker has been created.