henrytao-me / smooth-app-bar-layout

Smooth version of Google Support Design AppBarLayout
Apache License 2.0
1.76k stars 240 forks source link

Some previous items lost when using smooth app bar layout #16

Closed drakeet closed 9 years ago

drakeet commented 9 years ago

It's my layout xml content:

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/cl_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_gank"
    tools:context="me.drakeet.meizhi.ui.GankActivity.GankFragment">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_gank"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <me.henrytao.smoothappbarlayout.SmoothAppBarLayout
        android:id="@+id/header_appbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/gank_header_height">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleTextAppearance="@style/CollapsingToolbarTitleStyle"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_collapseMode="parallax">

                <me.drakeet.meizhi.widget.VideoImageView
                    android:id="@+id/iv_video"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@color/theme_primary_darker"
                    android:scaleType="centerCrop"/>

                <ImageView
                    android:layout_width="36dp"
                    android:layout_height="36dp"
                    android:layout_gravity="center"
                    android:src="@mipmap/ic_play"/>

            </FrameLayout>

        </android.support.design.widget.CollapsingToolbarLayout>

    </me.henrytao.smoothappbarlayout.SmoothAppBarLayout>

</android.support.design.widget.CoordinatorLayout>

And my screenshot when using smooth app bar layout:

163 pic_hd

As you see, some dispeard items lost,It was supposed to be like this:

163 pic_hd

Here is certainly a number of issues, perhaps you can look at my Adapter of my RecyclerView to get the reason and fix it, it is open source:

https://github.com/drakeet/Meizhi/blob/master/app/src/main/java/me/drakeet/meizhi/ui/adapter/GankListAdapter.java

Thank you very much, and I will try to fix it with you ^ ^

drakeet commented 9 years ago

Sorry, I already know why, the Header Views cover the part of RecyclerView ... Maybe I should give it a padding

drakeet commented 9 years ago

I see and understand: It must add a HeaderView --> HeaderHolder(layoutInflater, viewGroup, R.layout.item_header_spacing);

ok, I know how to do now. sorry and thanks for your great work!

henrytao-me commented 9 years ago

Look like you have ViewPager below Toolbar. Is that correct? If so, just want to let you know, I am working on ViewPager support. It's almost done and will be pushed to production this weekend.