File tree 2 files changed +21
-2
lines changed
android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -631,8 +631,15 @@ public void handleMarkers()
631
631
return ;
632
632
}
633
633
634
- final ListItemProxy [] items =
635
- new ListItemProxy [] { listView .getFirstVisibleItem (), listView .getLastVisibleItem ()};
634
+ final ArrayList <ListItemProxy > items = new ArrayList <>();
635
+ final LinearLayoutManager lm = listView .getLayoutManager ();
636
+ final int firstVisibleItemPos = lm .findFirstVisibleItemPosition ();
637
+ final int lastVisibleItemPos = lm .findLastVisibleItemPosition ();
638
+
639
+ // ideally markers should be triggered for all visible items between first and last visible ones
640
+ for (int i = firstVisibleItemPos ; i <= lastVisibleItemPos ; i ++) {
641
+ items .add (listView .getVisibleItemAt (i ));
642
+ }
636
643
637
644
for (final ListItemProxy item : items ) {
638
645
if (item != null ) {
Original file line number Diff line number Diff line change @@ -571,6 +571,18 @@ public ListItemProxy getFirstVisibleItem()
571
571
return null ;
572
572
}
573
573
574
+ public ListItemProxy getVisibleItemAt (int index )
575
+ {
576
+ final View itemView = getLayoutManager ().findViewByPosition (index );
577
+
578
+ if (itemView == null ) {
579
+ return null ;
580
+ }
581
+
582
+ // Obtain list item proxy
583
+ return ((ListViewHolder ) recyclerView .getChildViewHolder (itemView )).getProxy ();
584
+ }
585
+
574
586
/**
575
587
* Obtain last visible list item proxy.
576
588
*
You can’t perform that action at this time.
0 commit comments