Add find visible items for list and flowlayout

This commit is contained in:
pengfei.zhou
2021-10-12 16:33:04 +08:00
committed by osborn
parent 1f511823c5
commit 6cae752456
19 changed files with 172 additions and 138 deletions

View File

@@ -41,6 +41,7 @@ class FlowDemo extends Panel {
}).also(it => {
if (idx == 15) {
it.fullSpan = true
it.identifier = "fullSpan"
}
})
},
@@ -62,7 +63,14 @@ class FlowDemo extends Panel {
height: 50,
fullSpan: true,
layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST),
})
}),
onScrollEnd: async () => {
const ret = await flowView.findCompletelyVisibleItems(context)
loge('completelyVisible Items is:', ret)
const ret2 = await flowView.findVisibleItems(context)
loge('visible Items is:', ret2)
}
}).in(rootView)
}

View File

@@ -111,6 +111,12 @@ class ListVM extends ViewModel<ListModel, ListVH> {
state.data = state.data.concat(ret.data)
state.offset = state.data.length
})
},
onScrollEnd: async () => {
const ret = await vh.list.findCompletelyVisibleItems(context)
loge('completelyVisible Items is:', ret)
const ret2 = await vh.list.findVisibleItems(context)
loge('visible Items is:', ret2)
}
})
loadData(state.offset).then(ret => {