<commit_before>---
name: Titanium.UI.ListItem
summary: A list item is an individual item in a list section.
description: |
    A list item is a combination of a <ListDataItem> and <ItemTemplate>.  The list data item
    represents the actual data, while the item template represents the style elements of the item.

    You do not create `ListItem` objects the same way you do other Titanium proxies.
    A `Ti.UI.createListItem` method does not exist to create list item objects.

    Instead, you have to pass a <ListDataItem> array to the `setItems` method of a `ListSection`.
    The list data items contain the data you want to display in the list.

    By default, only the `title`, `image` and `accessoryType` keys of the list data item's
    `properties` dictionary are displayed if an item template is not defined.  See "Default List Item"
    for an example of using the default template.

    #### Item Templates

    To customize the style of a list item, use an item template to create your view structure.

    Add key-value pairs of view properties and their values to the `properties` dictionary of the
    item template to set view properties of the list item.

    Add key-value pairs of event names and their callback functions (or array of callback functions
    for multiple callback bindings) to the `events` dictionary of the  item template to bind callbacks
    to events, which are bubbled from the subcomponents of the item.

    Add additional views, such as labels or image views, to the `childTemplates` array of the item
    template. The child templates are item templates with two extra properties:

    - Set the `type` property to a Titanium view class, such as `Ti.UI.Label` or `Ti.UI.ImageView`,
      to use that view in your template.
    - Set the `bindId` to bind the template to a custom property in the list data item. The custom
      properties in the list data item contain key-value pairs of view properties and their values.

    For example, suppose you have a list data item defined as `{foo:{text: 'foobar'}}` and an item
    template defined as `{childTemplates: [{type: 'Ti.UI.Label', bindId: 'foo'}]}`.  The `foo`
    property in the list data item binds to the label in the template, which sets the `text`
    property of the label in the template to the `text` property in the list data item.

    To bind the list data item to an item template, use the <Titanium.UI.ListView.templates>
    property to map the template to a style name, then use the style name to either set the
    <Titanium.UI.ListView.defaultItemTemplate> property to globally set the style for all items or set the
    `template` property of the list data item to override or individually set the style.

    On iOS, you can specify one of the template constants for the <ListDataItem.template> property
    or <Titanium.UI.ListView.defaultItemTemplate> property: <Titanium.UI.LIST_ITEM_TEMPLATE_CONTACTS>,
    <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.

    #### Eventing

    Unlike other views, you cannot use the `addEventListener` method to bind callbacks to events for a
    ListItem.

    Use the ListView's [itemclick](Titanium.UI.ListView.itemclick) event to monitor click events on
    items in the list view. Do not rely on the `source` property to determine which item fired the
    event.  Either use the `sectionIndex` and `itemIndex`, or the `itemId` to determine the list item
    that generated the event, and use the `bindId` to check which child control fired the event.
    See "Default List Item" for an example of using the `itemclick` event.

    To monitor events that bubble to the ListItem or to monitor events of the view subcomponents,
    bind them to the item by using the `events` dictionary of the item template or the child view
    templates, respectively. Add the bindings as key-value pairs, where the key is the event name
    and the value is the callback (or array of callbacks for multiple bindings). See "List Items
    with an Item Template" for an example of binding a `click` event to an item using an item template.

platforms: [android, ipad, iphone]
since: '3.1.0'
extends: Titanium.Proxy
createable: false
excludes:
    methods: [addEventListener, applyProperties, fireEvent, removeEventListener]
    properties: [bubbleParent]
properties:

  - name: itemId
    summary: A user defined string that gets passed to events.
    type: String

  - name: accessoryType
    summary: Sets an accessory on the right side of an item.
    description: |
        Specify one of the following:
        <Titanium.UI.LIST_ACCESSORY_TYPE_CHECKMARK>,
        <Titanium.UI.LIST_ACCESSORY_TYPE_DETAIL>,
        <Titanium.UI.LIST_ACCESSORY_TYPE_DISCLOSURE>,
        or <Titanium.UI.LIST_ACCESSORY_TYPE_NONE>.
    type: Number
    default: Titanium.UI.LIST_ACCESSORY_TYPE_NONE

  - name: allowsSelection
    summary: Determines whether this item can be selected.
    description: |
        Set to `false` to prevent the item from being selected.

        On iOS, even if this property is set to `false`, you can interact with the detail disclosure
        accessory (`accessoryType` set to <Titanium.UI.LIST_ACCESSORY_TYPE_DETAIL>) and any child
        templates that are controls, such as a button, slider, etc.
    type: Boolean
    default: true
    platforms: [iphone, ipad]

  - name: backgroundColor
    summary: Background color of the view, as a color name or hex triplet.
    description: |
        For information about color values, see the "Colors" section of <Titanium.UI>.
    type: String
    default: Transparent

  - name: color
    summary: Default text color of the item when not selected, as a color name or hex triplet.
    description: |
        For information about color values, see the "Colors" section of <Titanium.UI>.

        On Android, `selectedColor` is not supported, so the text is always displayed in this color.

        Only applies to the built-in templates.
    type: String

  - name: font
    summary: Font to use for the item title.
    description: |
        Only applies to the built-in templates.
    type: Font
    default: System default font.

  - name: height
    summary: Row height in platform-specific units.
    description: |
        On Android, the value can be either a float value or a dimension string, for example, '40dp'.

        On iOS, the value can only be an absolute value.
    type: [Number,String]

  - name: image
    summary: Image to render in the image area of the item, specified as a local path or URL.
    description: |
        On iOS, the image is on the left, and on Android, the image is on the right.

        On Android, this image only appears on the default template.

        On iOS, only local images are supported.

        On iOS, this image only appears if the ListDataItem `template` property or ListView
        `defaultItemTemplate` property is either: <Titanium.UI.LIST_ITEM_TEMPLATE_DEFAULT>,
        <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.
    type: String

  - name: title
    summary: Title to set in the text area of the item.
    description: |
        This title only appears for the built-in templates.
    type: String

  - name: selectionStyle
    summary: Selection style constant to control the selection color.
    description: |
        Specify one of the constants from <Titanium.UI.iPhone.ListViewCellSelectionStyle>.
    type: Number
    platforms: [iphone,ipad]

  - name: subtitle
    summary: Subtitle to set in the text area of the item.
    description: |
        This subtitle only appears if the ListDataItem `template` property or ListView
        `defaultItemTemplate` property is set to either: <Titanium.UI.LIST_ITEM_TEMPLATE_CONTACTS>,
        <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.
    type: String
    platforms: [iphone,ipad]

examples:
  - title: Default List Items
    example: |
        Creates a list without using an item template. Monitors the `itemclick` event to check and
        uncheck tasks.

            var win = Ti.UI.createWindow({backgroundColor: 'white'});
            var listView = Ti.UI.createListView();

            var tasks = [
                {id: 'trash', name: 'Take Out the Trash', icon: 'trash.png'},
                {id: 'dishes', name: 'Do the Dishes', icon: 'dishes.png'},
                {id: 'doggie', name: 'Walk the Dog', icon: 'doggie.png'}
            ];

            var data = [];
            for (var i = 0; i < tasks.length; i++) {
                data.push(
                    { properties: {
                        itemId: tasks[i].id,
                        title: tasks[i].name,<commit_msg>[TIDOC-1084] Hide accessors for ListItem<commit_after>---
name: Titanium.UI.ListItem
summary: A list item is an individual item in a list section.
description: |
    A list item is a combination of a <ListDataItem> and <ItemTemplate>.  The list data item
    represents the actual data, while the item template represents the style elements of the item.

    You do not create `ListItem` objects the same way you do other Titanium proxies.
    A `Ti.UI.createListItem` method does not exist to create list item objects.

    Instead, you have to pass a <ListDataItem> array to the `setItems` method of a `ListSection`.
    The list data items contain the data you want to display in the list.

    By default, only the `title`, `image` and `accessoryType` keys of the list data item's
    `properties` dictionary are displayed if an item template is not defined.  See "Default List Item"
    for an example of using the default template.

    #### Item Templates

    To customize the style of a list item, use an item template to create your view structure.

    Add key-value pairs of view properties and their values to the `properties` dictionary of the
    item template to set view properties of the list item.

    Add key-value pairs of event names and their callback functions (or array of callback functions
    for multiple callback bindings) to the `events` dictionary of the  item template to bind callbacks
    to events, which are bubbled from the subcomponents of the item.

    Add additional views, such as labels or image views, to the `childTemplates` array of the item
    template. The child templates are item templates with two extra properties:

    - Set the `type` property to a Titanium view class, such as `Ti.UI.Label` or `Ti.UI.ImageView`,
      to use that view in your template.
    - Set the `bindId` to bind the template to a custom property in the list data item. The custom
      properties in the list data item contain key-value pairs of view properties and their values.

    For example, suppose you have a list data item defined as `{foo:{text: 'foobar'}}` and an item
    template defined as `{childTemplates: [{type: 'Ti.UI.Label', bindId: 'foo'}]}`.  The `foo`
    property in the list data item binds to the label in the template, which sets the `text`
    property of the label in the template to the `text` property in the list data item.

    To bind the list data item to an item template, use the <Titanium.UI.ListView.templates>
    property to map the template to a style name, then use the style name to either set the
    <Titanium.UI.ListView.defaultItemTemplate> property to globally set the style for all items or set the
    `template` property of the list data item to override or individually set the style.

    On iOS, you can specify one of the template constants for the <ListDataItem.template> property
    or <Titanium.UI.ListView.defaultItemTemplate> property: <Titanium.UI.LIST_ITEM_TEMPLATE_CONTACTS>,
    <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.

    #### Eventing

    Unlike other views, you cannot use the `addEventListener` method to bind callbacks to events for a
    ListItem.

    Use the ListView's [itemclick](Titanium.UI.ListView.itemclick) event to monitor click events on
    items in the list view. Do not rely on the `source` property to determine which item fired the
    event.  Either use the `sectionIndex` and `itemIndex`, or the `itemId` to determine the list item
    that generated the event, and use the `bindId` to check which child control fired the event.
    See "Default List Item" for an example of using the `itemclick` event.

    To monitor events that bubble to the ListItem or to monitor events of the view subcomponents,
    bind them to the item by using the `events` dictionary of the item template or the child view
    templates, respectively. Add the bindings as key-value pairs, where the key is the event name
    and the value is the callback (or array of callbacks for multiple bindings). See "List Items
    with an Item Template" for an example of binding a `click` event to an item using an item template.

platforms: [android, ipad, iphone]
since: '3.1.0'
extends: Titanium.Proxy
createable: false
excludes:
    methods: [addEventListener, applyProperties, fireEvent, removeEventListener]
    properties: [bubbleParent]
properties:

  - name: itemId
    summary: A user defined string that gets passed to events.
    type: String
    accessors: false

  - name: accessoryType
    summary: Sets an accessory on the right side of an item.
    description: |
        Specify one of the following:
        <Titanium.UI.LIST_ACCESSORY_TYPE_CHECKMARK>,
        <Titanium.UI.LIST_ACCESSORY_TYPE_DETAIL>,
        <Titanium.UI.LIST_ACCESSORY_TYPE_DISCLOSURE>,
        or <Titanium.UI.LIST_ACCESSORY_TYPE_NONE>.
    type: Number
    default: Titanium.UI.LIST_ACCESSORY_TYPE_NONE
    accessors: false

  - name: allowsSelection
    summary: Determines whether this item can be selected.
    description: |
        Set to `false` to prevent the item from being selected.

        On iOS, even if this property is set to `false`, you can interact with the detail disclosure
        accessory (`accessoryType` set to <Titanium.UI.LIST_ACCESSORY_TYPE_DETAIL>) and any child
        templates that are controls, such as a button, slider, etc.
    type: Boolean
    default: true
    platforms: [iphone, ipad]
    accessors: false

  - name: backgroundColor
    summary: Background color of the view, as a color name or hex triplet.
    description: |
        For information about color values, see the "Colors" section of <Titanium.UI>.
    type: String
    default: Transparent
    accessors: false

  - name: color
    summary: Default text color of the item when not selected, as a color name or hex triplet.
    description: |
        For information about color values, see the "Colors" section of <Titanium.UI>.

        On Android, `selectedColor` is not supported, so the text is always displayed in this color.

        Only applies to the built-in templates.
    type: String
    accessors: false

  - name: font
    summary: Font to use for the item title.
    description: |
        Only applies to the built-in templates.
    type: Font
    default: System default font.
    accessors: false

  - name: height
    summary: Row height in platform-specific units.
    description: |
        On Android, the value can be either a float value or a dimension string, for example, '40dp'.

        On iOS, the value can only be an absolute value.
    type: [Number,String]
    accessors: false

  - name: image
    summary: Image to render in the image area of the item, specified as a local path or URL.
    description: |
        On iOS, the image is on the left, and on Android, the image is on the right.

        On Android, this image only appears on the default template.

        On iOS, only local images are supported.

        On iOS, this image only appears if the ListDataItem `template` property or ListView
        `defaultItemTemplate` property is either: <Titanium.UI.LIST_ITEM_TEMPLATE_DEFAULT>,
        <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.
    type: String
    accessors: false

  - name: title
    summary: Title to set in the text area of the item.
    description: |
        This title only appears for the built-in templates.
    type: String
    accessors: false

  - name: selectionStyle
    summary: Selection style constant to control the selection color.
    description: |
        Specify one of the constants from <Titanium.UI.iPhone.ListViewCellSelectionStyle>.
    type: Number
    platforms: [iphone,ipad]
    accessors: false

  - name: subtitle
    summary: Subtitle to set in the text area of the item.
    description: |
        This subtitle only appears if the ListDataItem `template` property or ListView
        `defaultItemTemplate` property is set to either: <Titanium.UI.LIST_ITEM_TEMPLATE_CONTACTS>,
        <Titanium.UI.LIST_ITEM_TEMPLATE_SETTINGS> or <Titanium.UI.LIST_ITEM_TEMPLATE_SUBTITLE>.
    type: String
    platforms: [iphone,ipad]
    accessors: false

examples:
  - title: Default List Items
    example: |
        Creates a list without using an item template. Monitors the `itemclick` event to check and
        uncheck tasks.

            var win = Ti.UI.createWindow({backgroundColor: 'white'});
            var listView = Ti.UI.createListView();

            var tasks = [
                {id: 'trash', name: 'Take Out the Trash', icon: 'trash.png'},
                {id: 'dishes', name: 'Do the Dishes', icon: 'dishes.png'},
                {id: 'doggie', name: 'Walk the Dog', icon: 'doggie.png'}
            ];

            var data = [];
            for (var i = 0; i < tasks.length; i++) {
                data.push(
                    { properties: {
                        itemId: tasks[i].id,
                        title: tasks[i].name,
{'fraction_non_alphanumeric': 0.06569178852643419, 'fraction_numerical': 0.0008998875140607424, 'mean_word_length': 3.0210312075983716, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5605504', 'n_tokens_mistral': 4901, 'n_tokens_neox': 4734, 'n_words': 2267}