{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: resourceId(\"com.salesforce.chatter:id/find_objects_view\"), resourceId(\"com.salesforce.chatter:id/nav_menu_list\"), or resourceId(\"com.salesforce.chatter:id/view_allItems\").",
            "Represents the Android generic item list.",
            "Check for an item in the list and navigate to it."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/navigation/navItemsList",
    "platform": "native",
    "profile": [
        {
            "platform": [
                "android_phone",
                "android_tablet"
            ]
        }
    ],
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "isPresent"
                        }
                    ]
                }
            ]
        }
    ],
    "exposeRootElement": true,
    "type": [
        "actionable",
        "touchable"
    ],
    "elements": [
        {
            "name": "visibleNavItems",
            "type": [
                "clickable",
                "actionable"
            ],
            "public": true,
            "selector": {
                "uiautomator": "className(\"android.widget.RelativeLayout\").className(\"android.widget.TextView\")",
                "returnAll": true
            }
        },
        {
            "name": "navItemWithLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "uiautomator": "new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(className(\"android.widget.TextView\").text(\"%s\"))",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "visibleNavItemWithLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "public": true,
            "selector": {
                "uiautomator": "className(\"android.widget.TextView\").text(\"%s\")",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "hasNavItemWithLabel",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "navItemWithLabel",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "clickNavItemWithLabel",
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "navItemWithLabel",
                                    "apply": "click"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "pullToRefresh",
            "compose": [
                {
                    "element": "root",
                    "apply": "flick",
                    "args": [
                        {
                            "value": 0
                        },
                        {
                            "value": 400
                        }
                    ]
                }
            ]
        }
    ]
}