eowise / recyclerview-stickyheaders

DEPRECATED. Android library that integrate sticky section headers in your RecyclerView
http://eowise.github.io/recyclerview-stickyheaders
MIT License
960 stars 148 forks source link

Header is drawn on top of scrollbar #11

Closed vovan888 closed 9 years ago

vovan888 commented 9 years ago

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 commented 9 years ago

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...

vovan888 commented 9 years ago

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 commented 9 years ago

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 : 2f3bc26f1bb02019a5be08178ec2118813cb14a0

vovan888 commented 9 years ago

Thanks a lot for the new options :)

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