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

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

Closed
drakeet opened this issue Oct 8, 2015 · 3 comments
Closed

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

drakeet opened this issue Oct 8, 2015 · 3 comments

Comments

@drakeet
Copy link
Contributor

drakeet commented Oct 8, 2015

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 drakeet changed the title Some dispeard items lost when using smooth app bar layout Some previous items lost when using smooth app bar layout Oct 8, 2015
@drakeet
Copy link
Contributor Author

drakeet commented Oct 8, 2015

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

@drakeet
Copy link
Contributor Author

drakeet commented Oct 8, 2015

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!

@drakeet drakeet closed this as completed Oct 8, 2015
@henrytao-me
Copy link
Owner

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.

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