diff --git a/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/GridView.kt b/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/GridView.kt index 009c1e1..ef9fea1 100644 --- a/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/GridView.kt +++ b/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/GridView.kt @@ -51,6 +51,7 @@ data class GridView constructor( val scrollEndThreshold: Int? = null, val isScrollIndicatorVisible: Boolean = false, val iteratorName: String = "item", + val indexName: String = "index", val key: String? = null, val spanCount: Int? = null, val direction: GridViewDirection? = VERTICAL, diff --git a/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/ListView.kt b/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/ListView.kt index c3fbdc1..b4e0909 100644 --- a/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/ListView.kt +++ b/framework/src/main/kotlin/br/com/zup/beagle/widget/ui/ListView.kt @@ -47,6 +47,7 @@ data class ListView( val onScrollEnd: List? = null, val scrollEndThreshold: Int? = null, val iteratorName: String = "item", + val indexName: String = "index", val isScrollIndicatorVisible: Boolean = false, val key: String? = null, val useParentScroll: Boolean? = null, diff --git a/framework/src/test/kotlin/br/com/zup/beagle/serialization/components/stubs/Widgets.kt b/framework/src/test/kotlin/br/com/zup/beagle/serialization/components/stubs/Widgets.kt index aad6887..aaa92e9 100644 --- a/framework/src/test/kotlin/br/com/zup/beagle/serialization/components/stubs/Widgets.kt +++ b/framework/src/test/kotlin/br/com/zup/beagle/serialization/components/stubs/Widgets.kt @@ -169,6 +169,7 @@ fun makeJsonGridView() = """ "scrollEndThreshold": 80, "isScrollIndicatorVisible": true, "iteratorName": "listItem", + "indexName": "index", "key": "listKey", "spanCount": 2, "direction": "HORIZONTAL" @@ -280,6 +281,7 @@ fun makeObjectGridView() = GridView( scrollEndThreshold = 80, isScrollIndicatorVisible = true, iteratorName = "listItem", + indexName = "index", key = "listKey", spanCount = 2, direction = GridViewDirection.HORIZONTAL @@ -315,6 +317,7 @@ fun makeListViewJson() = """ "onScrollEnd": [${makeActionAlertJson()}], "scrollEndThreshold": 80, "iteratorName": "itemTest", + "indexName": "index", "isScrollIndicatorVisible": false, "key": "key", "templates":[ @@ -335,6 +338,7 @@ fun makeObjectListView() = ListView( scrollEndThreshold = 80, isScrollIndicatorVisible = false, iteratorName = "itemTest", + indexName = "index", key = "key", templates = listOf( Template(