mzgreen / HideOnScrollExample

This is an example on how to show/hide views when scrolling a list.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neither demo handles the top over scroll effect correctly

chrislacy opened this issue · comments

In Part 1 only the bottom portion is visible beneath the Toolbar.
In Part 2 it's not visible at all.

Thanks for reporting this. I've completely forgot about this to be honest :)
Also I've looked at Google+ and Play Store apps on which I was basing my implementation and it seems that Play Store also has this bug and G+ has SwipeToRefresh.
Anyways I'll try to fix this.

Actually I can't see any simple way to fix this. It seems that there is no way to move the origin of glow effect in the RecyclerView.

This is from it's onDraw() method:

        if (mTopGlow != null && !mTopGlow.isFinished()) {
            final int restore = c.save();
            if (mClipToPadding) {
                c.translate(getPaddingLeft(), getPaddingTop());
            }
            needsInvalidate |= mTopGlow != null && mTopGlow.draw(c);
            c.restoreToCount(restore);
        }

And I'm using clipToPadding="false" so it's not going to translate it. Do you have any idea what can be done here? I think that I could add a margin to the first item of the list using ItemDecoration and it could help but if someone would need to use it with GridLayoutManager or StaggeredGridLayoutManager then it becomes tricky.

It's now handled by CoordinatorLayout.