emilsjolander/StickyScrollViewItems

Calculating dimensions of null views after removing views from ScrollView's child.

Opened this issue · 2 comments

I am getting an error when I remove views from the ScrollView's child. When I do so, the get*ForViewRelativeOnlyChild methods are being still being called. Because I have removed views, I am getting a null pointer error when view objects in these method are used.

@emilsjolander, in the invalidateRunnable's run() method, what is the point of the posDelayed(this, 16) call? Is it necessary to invalidate the currentlyStickingView's area every 16ms?

The way this is built now, yes. I built this a pretty long time ago and when i have the time i would like to re-write big parts. As i remember it i draw the sticking view manually so when providing the NON_CONSTANT flag on the sticky view indicating that this view's drawing can change at any time i need to invalidate the view on every frame to ensure that the view is drawn correctly. A re-write would make sure to let android's view framework handle the sticky view which would ensure that the drawing of the view was only updated when needed.