Wrap List Container: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Big Noid
 
(19 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The wrap list container is one of several containers used to display items from file lists in various ways. The wrap list container is the same as the [[List Container]], with two exceptions:
<section begin="main content" />
1.  The focused item is fixed.
The wrap list container is one of several containers used to display items from file lists in various ways. The wrap list container is the same as the [[List Container]], with two exceptions:
2.  The items "wrap" around once they reach the end.
 
# The focused item is fixed.
# The items "wrap" around once they reach the end.
 
As with all container controls, the layout of the items within the control is very flexible.
As with all container controls, the layout of the items within the control is very flexible.
===Example===
=== Example ===
<source lang="xml">
<syntaxhighlight lang="XML" enclose="div">
<control type="wraplist" id="50">
<control type="wraplist" id="50">
       <description>My first wraplist container</description>
       <description>My first wraplist container</description>
       <posx>80</posx>
       <left>80</left>
       <posy>60</posy>
       <top>60</top>
       <width>250</width>
       <width>250</width>
       <height>200</height>
       <height>200</height>
Line 20: Line 23:
       <pagecontrol>25</pagecontrol>
       <pagecontrol>25</pagecontrol>
       <focusposition>3</focusposition>
       <focusposition>3</focusposition>
       <scrolltime>200</scrolltime>
       <scrolltime tween="sine" easing="out">200</scrolltime>
       <itemlayout width="250" height="29">
      <autoscroll>true</autoscroll>
       <itemlayout width="650" height="29">
<control type="image">
<control type="image">
<posx>5</posx>
<left>5</left>
<posy>3</posy>
<top>3</top>
<width>22</width>
<width>22</width>
<height>22</height>
<height>22</height>
<info>ListItem.Icon</info>
<texture>$INFO[ListItem.Icon]</texture>
</control>
</control>
<control type="label">
<control type="label">
<posx>30</posx>
<left>30</left>
<posy>3</posy>
<top>3</top>
<width>430</width>
<width>430</width>
<height>22</height>
<height>22</height>
Line 38: Line 42:
<selectedcolor>green</selectedcolor>
<selectedcolor>green</selectedcolor>
<align>left</align>
<align>left</align>
<info>ListItem.Label</info>
<label>$INFO[ListItem.Label]</label>
</control>
</control>
<control type="label">
<control type="label">
<posx>475</posx>
<left>475</left>
<posy>3</posy>
<top>3</top>
<width>300</width>
<width>300</width>
<height>22</height>
<height>22</height>
Line 50: Line 54:
<textcolor>grey</textcolor>
<textcolor>grey</textcolor>
<align>right</align>
<align>right</align>
<info>ListItem.Label2</info>
<label>$INFO[ListItem.Label2]</label>
</control>
</control>
       </itemlayout>
       </itemlayout>
       <focusedlayout height="29" width="250">
       <focusedlayout height="29" width="650">
<control type="image">
<control type="image">
<width>485</width>
<width>485</width>
<height>29</height>
<height>29</height>
<posx>0</posx>
<left>0</left>
<posy>0</posy>
<top>0</top>
<visible>Control.HasFocus(50)</visible>
<visible>Control.HasFocus(50)</visible>
<texture>list-focus.png</texture>
<texture>list-focus.png</texture>
</control>
</control>
<control type="image">
<control type="image">
<posx>5</posx>
<left>5</left>
<posy>3</posy>
<top>3</top>
<width>22</width>
<width>22</width>
<height>22</height>
<height>22</height>
<info>ListItem.Icon</info>
<texture>$INFO[ListItem.Icon]</texture>
</control>
</control>
<control type="label">
<control type="label">
<posx>30</posx>
<left>30</left>
<posy>3</posy>
<top>3</top>
<width>430</width>
<width>430</width>
<height>22</height>
<height>22</height>
Line 78: Line 82:
<selectedcolor>green</selectedcolor>
<selectedcolor>green</selectedcolor>
<align>left</align>
<align>left</align>
<info>ListItem.Label</info>
<label>$INFO[ListItem.Label]</label>
</control>
</control>
<control type="label">
<control type="label">
<posx>475</posx>
<left>475</left>
<posy>3</posy>
<top>3</top>
<width>300</width>
<width>300</width>
<height>22</height>
<height>22</height>
Line 90: Line 94:
<textcolor>grey</textcolor>
<textcolor>grey</textcolor>
<align>right</align>
<align>right</align>
<info>ListItem.Label2</info>
<label>$INFO[ListItem.Label2]</label>
</control>
</control>
       </focusedlayout>
       </focusedlayout>
</control>
</control>
</source>
</syntaxhighlight>


===Available Tags===
=== Available tags ===
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
{| class="dtable"
 
|- class="userrow"
{| class="prettytable"
| class="usercell" | '''viewtype'''
! Tag !! Description
| class="usercell" | The type of view. Choices are list, icon, wide, wrap, biglist, bigicon, bigwide, and bigwrap. The label attribute indicates the label that will be used in the "View As" control within the GUI. It is localizable via strings.xml.
|-  
|- class="userrow"
| '''viewtype'''
| class="usercell" | '''orientation'''
| The type of view. Choices are list, icon, wide, wrap, biglist, bigicon, bigwide, bigwrap, info and biginfo. The label attribute indicates the label that will be used in the "View As" control within the GUI. It is localizable via strings.po. ''viewtype'' has no effect on the view itself. It is used by kodi when switching skin to automatically select a view with a similar layout. Skinners should try to set ''viewtype'' to describe the layout as best as possible.  
| class="usercell" | The orientation of the list. Defaults to vertical.
|-  
|- class="userrow"
| '''orientation'''
| class="usercell" | '''pagecontrol'''
| The orientation of the list. Defaults to vertical.
| class="usercell" | Used to set the <id> of the page control used to control this list.
|-  
|- class="userrow"
| '''pagecontrol'''
| class="usercell" | '''scrolltime'''
| Used to set the <id> of the page control used to control this list.
| class="usercell" | The time (in ms) to scroll from one item to another.  By default, this is 200ms.  The list will scroll smoothly from one item to another as needed. Set it to zero to disable the smooth scrolling.
|-  
|- class="userrow"
| '''scrolltime'''
| class="usercell" | '''focusposition'''
| The time (in ms) to scroll from one item to another.  By default, this is 200ms.  The list will scroll smoothly from one item to another as needed. Set it to zero to disable the smooth scrolling. The scroll movement can be further adjusted by selecting one of the available [[Tweeners|tween]] methods.
| class="usercell" | Specifies the index (from 0 -> number items displayable - 1) of the focused item.  The focused item doesn't move - as the user moves up and down (or left and right) the items scroll instead.
|-  
|- class="userrow"
| '''focusposition'''
| class="usercell" | '''itemlayout'''
| Specifies the index (from 0 -> number items displayable - 1) of the focused item.  The focused item doesn't move - as the user moves up and down (or left and right) the items scroll instead.
| class="usercell" | Specifies the layout of items in the list. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <itemlayout> then contains as many label and image controls as required. [[Container Item Layout|See here for more information.]]
|-  
|- class="userrow"
| '''itemlayout'''
| class="usercell" | '''focusedlayout'''
| Specifies the layout of items in the list. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <itemlayout> then contains as many label and image controls as required. [[Container Item Layout|See here for more information.]]
| class="usercell" | Specifies the layout of items in the list that have focus. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <focusedlayout> then contains as many label and image controls as required. [[Container Item Layout|See here for more information.]]
|-  
|- class="userrow"
| '''focusedlayout'''
| class="usercell" | '''content'''
| Specifies the layout of items in the list that have focus. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <focusedlayout> then contains as many label and image controls as required. [[Container Item Layout|See here for more information.]]
| class="usercell" | Used to set the item content that this list will contain. Allows the skinner to setup a list anywhere they want with a static set of content, as a useful alternative to the grouplist control. [[Static List Content|See here for more information]]
|-  
| '''content'''
| Used to set the item content that this list will contain. Allows the skinner to setup a list anywhere they want with a static set of content, as a useful alternative to the grouplist control. [[Static List Content|See here for more information]]
|-
|  '''autoscroll'''
|  Used to make the container scroll automatically
|}
|}


[[category:Skin Development]]
<section end="main content" />
 
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
 
[[Category:Skin development]]

Latest revision as of 00:51, 14 April 2022

The wrap list container is one of several containers used to display items from file lists in various ways. The wrap list container is the same as the List Container, with two exceptions:

  1. The focused item is fixed.
  2. The items "wrap" around once they reach the end.

As with all container controls, the layout of the items within the control is very flexible.

Example

<control type="wraplist" id="50">
      <description>My first wraplist container</description>
      <left>80</left>
      <top>60</top>
      <width>250</width>
      <height>200</height>
      <visible>true</visible>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
      <viewtype label="3D list">list</viewtype>
      <orientation>vertical</orientation>
      <pagecontrol>25</pagecontrol>
      <focusposition>3</focusposition>
      <scrolltime tween="sine" easing="out">200</scrolltime>
      <autoscroll>true</autoscroll>
      <itemlayout width="650" height="29">
		<control type="image">
			<left>5</left>
			<top>3</top>
			<width>22</width>
			<height>22</height>
			<texture>$INFO[ListItem.Icon]</texture>
		</control>
		<control type="label">
			<left>30</left>
			<top>3</top>
			<width>430</width>
			<height>22</height>
			<font>font13</font>
			<aligny>center</aligny>
			<selectedcolor>green</selectedcolor>
			<align>left</align>
			<label>$INFO[ListItem.Label]</label>
		</control>
		<control type="label">
			<left>475</left>
			<top>3</top>
			<width>300</width>
			<height>22</height>
			<font>font13</font>
			<aligny>center</aligny>
			<selectedcolor>green</selectedcolor>
			<textcolor>grey</textcolor>
			<align>right</align>
			<label>$INFO[ListItem.Label2]</label>
		</control>
      </itemlayout>
      <focusedlayout height="29" width="650">
		<control type="image">
			<width>485</width>
			<height>29</height>
			<left>0</left>
			<top>0</top>
			<visible>Control.HasFocus(50)</visible>
			<texture>list-focus.png</texture>
		</control>
		<control type="image">
			<left>5</left>
			<top>3</top>
			<width>22</width>
			<height>22</height>
			<texture>$INFO[ListItem.Icon]</texture>
		</control>
		<control type="label">
			<left>30</left>
			<top>3</top>
			<width>430</width>
			<height>22</height>
			<font>font13</font>
			<aligny>center</aligny>
			<selectedcolor>green</selectedcolor>
			<align>left</align>
			<label>$INFO[ListItem.Label]</label>
		</control>
		<control type="label">
			<left>475</left>
			<top>3</top>
			<width>300</width>
			<height>22</height>
			<font>font13</font>
			<aligny>center</aligny>
			<selectedcolor>green</selectedcolor>
			<textcolor>grey</textcolor>
			<align>right</align>
			<label>$INFO[ListItem.Label2]</label>
		</control>
      </focusedlayout>
</control>

Available tags

In addition to the Default Control Tags the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

Tag Description
viewtype The type of view. Choices are list, icon, wide, wrap, biglist, bigicon, bigwide, bigwrap, info and biginfo. The label attribute indicates the label that will be used in the "View As" control within the GUI. It is localizable via strings.po. viewtype has no effect on the view itself. It is used by kodi when switching skin to automatically select a view with a similar layout. Skinners should try to set viewtype to describe the layout as best as possible.
orientation The orientation of the list. Defaults to vertical.
pagecontrol Used to set the <id> of the page control used to control this list.
scrolltime The time (in ms) to scroll from one item to another. By default, this is 200ms. The list will scroll smoothly from one item to another as needed. Set it to zero to disable the smooth scrolling. The scroll movement can be further adjusted by selecting one of the available tween methods.
focusposition Specifies the index (from 0 -> number items displayable - 1) of the focused item. The focused item doesn't move - as the user moves up and down (or left and right) the items scroll instead.
itemlayout Specifies the layout of items in the list. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <itemlayout> then contains as many label and image controls as required. See here for more information.
focusedlayout Specifies the layout of items in the list that have focus. Requires the height attribute set in a vertical list, and the width attribute set for a horizontal list. The <focusedlayout> then contains as many label and image controls as required. See here for more information.
content Used to set the item content that this list will contain. Allows the skinner to setup a list anywhere they want with a static set of content, as a useful alternative to the grouplist control. See here for more information
autoscroll Used to make the container scroll automatically


See also

Development: