android: fix findCompletelyVisibleItems typo

This commit is contained in:
pengfei.zhou 2021-10-11 18:36:38 +08:00 committed by osborn
parent f09f7859b9
commit 1f511823c5
2 changed files with 6 additions and 1 deletions

View File

@ -343,7 +343,7 @@ public class FlowLayoutNode extends SuperNode<RecyclerView> implements IDoricScr
@DoricMethod
public JSONArray findCompletelyVisibleItems() {
int[] startPos = staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(null);
int[] endPos = staggeredGridLayoutManager.findFirstCompletelyVisibleItemPositions(null);
int[] endPos = staggeredGridLayoutManager.findLastCompletelyVisibleItemPositions(null);
JSONArray jsonArray = new JSONArray();
for (int i = 0; i < staggeredGridLayoutManager.getSpanCount(); i++) {
jsonArray.put(new JSONBuilder()

View File

@ -1,4 +1,5 @@
import { Group, Panel, flowlayout, layoutConfig, FlowLayoutItem, text, Color, LayoutSpec, Gravity, flowItem, image } from "doric";
import { loge } from "doric/lib/src/util/log";
import { colors, label } from "./utils";
const imageUrls = [
@ -33,6 +34,10 @@ class FlowDemo extends Panel {
backgroundColor: colors[idx % colors.length],
height: 50 + (idx % 3) * 20,
layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST),
onClick: async () => {
const ret = await flowView.findCompletelyVisibleItems(context)
loge(ret)
}
}).also(it => {
if (idx == 15) {
it.fullSpan = true