Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header is drawn on top of scrollbar #11

Closed
vovan888 opened this issue Nov 8, 2014 · 4 comments
Closed

Header is drawn on top of scrollbar #11

vovan888 opened this issue Nov 8, 2014 · 4 comments
Assignees

Comments

@vovan888
Copy link
Contributor

vovan888 commented Nov 8, 2014

When scrolling RecycleView it is clearly visible that headers overlay scrollbar, looks like scrollbar is under the header.

My header layout:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="?listPreferredItemHeightSmall"
    android:background="@color/background_color"
    android:paddingTop="8dp"
    android:paddingStart="8dp"
    android:paddingEnd="8dp">

    <TextView
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:textAppearance="@style/TextAppearance.AppCompat.Title" />

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:src="?android:listDivider"
        android:scaleType="fitXY"/>

</FrameLayout>
@leruaa
Copy link
Member

leruaa commented Nov 9, 2014

I use RecyclerView ItemDecoration to draw headers on top of items by overriding onDrawOver() method. So I can't do anything to draw header under scrollbar.

A possible workaround may be to add more padding...

@leruaa leruaa closed this as completed Nov 9, 2014
@leruaa leruaa self-assigned this Nov 9, 2014
@vovan888
Copy link
Contributor Author

vovan888 commented Nov 9, 2014

I sort of fixed this by changing onDrawOver to onDraw in StickyHeadersItemDecoration.java. Can you please suggest how to disable "sticky" feature of the headers?

@leruaa
Copy link
Member

leruaa commented Nov 9, 2014

Indeed, by using onDraw() instead of onDrawOver(), headers overlay scrollbar, but items overlay sticky headers ;).

But it make sense with "sticky" feature disabled. See this commit on disabling sticky feature : 2f3bc26

@leruaa leruaa reopened this Nov 9, 2014
leruaa added a commit that referenced this issue Nov 9, 2014
@vovan888
Copy link
Contributor Author

vovan888 commented Nov 9, 2014

Thanks a lot for the new options :)

                .setSticky(false)
                .setDrawOrder(DrawOrder.UnderItems)

@vovan888 vovan888 closed this as completed Nov 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants