When I added VirtualFlow.visibleCells() listener I'm receiving not ending stream of events, but visible cells list is not changing.
The problem seemed to only affect lists where the cell is higher than the visible area (Maybe related to https://github.com/FXMisc/Flowless/pull/80).
VirtualFlow<T, C> view = ...;
//.....
view.visibleCells().addListener(new InvalidationListener() {
@Override
public void invalidated(Observable observable) {
System.out.println("a"); // <--- Not ending stream of events (printing `a`).
}
});
It publish events (memoizedItems.fireRemoveRange(memoChangeFrom, memoRemoved)) even if memoRemoved list is empty.
I'm not sure if this behavior in reactfx is good or wrong, but I found workaround to apply in Flowless in CellListManager.cropTo(...) to forget items only when memorizedRange is bigger then our fromItem-toItem range.
When I added
VirtualFlow.visibleCells()
listener I'm receiving not ending stream of events, but visible cells list is not changing. The problem seemed to only affect lists where the cell is higher than the visible area (Maybe related to https://github.com/FXMisc/Flowless/pull/80).I think the problem may be in package
org.reactfx:reactfx:2.0-M5
:MemorizationListImpl.forget(int from, int to)
https://github.com/TomasMikula/ReactFX/blob/537fffdbb2958a77dfbca08b712bb2192862e960/reactfx/src/main/java/org/reactfx/collection/MemoizationList.java#L176It publish events (
memoizedItems.fireRemoveRange(memoChangeFrom, memoRemoved)
) even ifmemoRemoved
list is empty.I'm not sure if this behavior in
reactfx
is good or wrong, but I found workaround to apply inFlowless
inCellListManager.cropTo(...)
toforget
items only whenmemorizedRange
is bigger then ourfromItem
-toItem
range.