Skip to content
Marcus Mascord edited this page Jul 15, 2014 · 6 revisions

The WidgetList is used for scrollable lists.

A list can be vertical or horizontal.

It is possible to mix of any other widget within this widget.

Attributes Type Description
m Widget The main widget class.
text String The actual text to be displayed.
s WidgetStyle The style of the widget.
widgetsCanBeMoved Boolean If true the user can move the objects within this list. The default value is false.
vertical Boolean Specifies if this is a vertical list or horizontal list. False = horizontal. The default is false.
showOutOfArea Boolean If this is set to true it shows the widgets out of x,y,w,h area of the list. If this is set to true the widgets will only be shown within the area of the list. The default is false.
gapWidget Widget This is widget that can be used as the gap widget. It is shown when the user's finger scrolls over it.
gapSize Integer Sets the gap size in pixels between the widgets.
currentOffset Integer This stores the current offset of the widgets within the list.
newOffset Integer Stores the offset in pixels of the list.
numberOfPixelsMovedToDraw Integer Specifies how many pixels need to be move for the list to be redrawn. Can improve performance on low end devices, the higher the number is set. The default value is 1. When == 1, 1 pixel move == 1 redraw. When 2 only every 2 pixel moves == redraw.
pixelsMoved Integer Specifies how many pixels move for each 1 pixel move by the user. This can make the lists scroll quicker. The default is 1.
kineticScrollingEnabled Boolean Sets if the kinetic scrolling is enabled to true or false. The default value is true.
widgetSize Integer This specifies the size of the widget.

XML List Widget Example

This is an example of the vertical list written in XML. The SimpleVerticalListFragment has been created in the common.xml file and is a Fragment widget. This list will display 16 items.

<Widget>
	<Id>SimpleVerticalList</Id>
	<Class>List</Class>
	<X>0</X>
	<Y>100</Y>
	<W>100%</W>
	<H>70%</H>
	<L>1</L>
	<GapSize>0</GapSize>
	<WidgetsCanBeMoved>False</WidgetsCanBeMoved>
	<Vertical>True</Vertical>
	<ShowOutOfArea>True</ShowOutOfArea>
	<Widgets>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 1</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 2</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 3</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 4</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 5</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 6</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 7</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 8</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 9</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 10</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 11</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 12</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 13</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 14</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 15</Text>
				</Widget>
			</Widgets>
		</Widget>
		<Widget>
			<Class>SimpleVerticalListFragment</Class>
			<Widgets>
				<Widget>
					<Id>SimpleVerticalListFragmentText</Id>
					<Text>List Item 16</Text>
				</Widget>
			</Widgets>
		</Widget>
	</Widgets>
</Widget>

The list will be displayed as shown:

Clone this wiki locally