File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -970,8 +970,15 @@ export class CollectionView extends CollectionViewBase {
970970 if ( ! view ) {
971971 return ;
972972 }
973- const ids = Array . from ( this . bindedViewHolders ) . sort ( ( a , b ) => a - b ) ;
974- this . _listViewAdapter . notifyItemRangeChanged ( ids [ 0 ] , ids [ ids . length - 1 ] - ids [ 0 ] + 1 ) ;
973+ const layoutManager = this . layoutManager as androidx . recyclerview . widget . LinearLayoutManager ;
974+ if ( layoutManager [ 'findFirstVisibleItemPosition' ] ) {
975+ const first = layoutManager . findFirstVisibleItemPosition ( ) ;
976+ const last = layoutManager . findLastVisibleItemPosition ( ) ;
977+ this . _listViewAdapter . notifyItemRangeChanged ( first , last + 1 ) ;
978+ } else {
979+ const ids = Array . from ( this . bindedViewHolders ) . sort ( ( a , b ) => a - b ) ;
980+ this . _listViewAdapter . notifyItemRangeChanged ( ids [ 0 ] , ids [ ids . length - 1 ] - ids [ 0 ] + 1 ) ;
981+ }
975982 }
976983 public isItemAtIndexVisible ( index : number ) : boolean {
977984 const view = this . nativeViewProtected ;
You can’t perform that action at this time.
0 commit comments