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

Snap flag not working #167

Open
s12u opened this issue Nov 28, 2016 · 2 comments
Open

Snap flag not working #167

s12u opened this issue Nov 28, 2016 · 2 comments

Comments

@s12u
Copy link

s12u commented Nov 28, 2016

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
   xmlns:http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <me.henrytao.smoothappbarlayout.SmoothAppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:minHeight="@dimen/app_bar_layout_min_height"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="@dimen/top_gallery_container_height"
            android:fitsSystemWindows="true"
            app:contentScrim="@color/colorPrimary"
            app:expandedTitleMarginBottom="76dp"
            app:expandedTitleMarginStart="32dp"
            app:expandedTitleTextAppearance="@style/RestaurantDetailInfoTitleText"
            app:layout_scrollFlags="scroll|enterAlwaysCollapsed|snap"
            app:statusBarScrim="@color/colorPrimary">

            <!-- top gallery container -->
            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="parallax">
                <RelativeLayout
                    android:id="@+id/top_gallery_container"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
            </FrameLayout>
            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/toolbar_height"
                android:background="@color/transparent"
                app:layout_collapseMode="pin" />

        </android.support.design.widget.CollapsingToolbarLayout>
        <android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="@dimen/tab_layout_height"
            app:tabBackground="@color/transparent"
            app:tabIndicatorColor="@color/colorPrimary"
            app:tabIndicatorHeight="4dp" />
    </me.henrytao.smoothappbarlayout.SmoothAppBarLayout>
</android.support.design.widget.CoordinatorLayout>

My code is here. But snap flag does not working. How do I use SmoothAppbarLayout's snap flags?

@henrytao-me
Copy link
Owner

Hi @s12u

SmoothAppBarLayout hasn't supported snap yet. During Droidcon NYC last month, Chris Banes from AppCompat team has pretty nice example about fixing fling issue of AppBarLayout. Hopefully it will be released soon. From now on, I just maintain and support other folks to work around on their issues, not implement new features. Sorry for that.

Cheers,
Henry

@s12u
Copy link
Author

s12u commented Nov 29, 2016

Thank you for answer @henrytao-me :)

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