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

Toolbar parent LinearLayout should be replaced with AppBarLayout to enable layout_scrollFlags for Toolbar programmatically #99

Open
LOG-TAG opened this issue Aug 2, 2016 · 0 comments

Comments

@LOG-TAG
Copy link

LOG-TAG commented Aug 2, 2016

To enable hide action bar (or Tab bar) while scrolling the list we need to change the Toolbar's LinearLayout parent to AppBarLayout !!!

Error becouse of LinearLayout :

 AppBarLayout.LayoutParams params =
                (AppBarLayout.LayoutParams)   this.getToolbar().getLayoutParams();

        params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
                | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);

this is the programmatic way but fails ending up error!!

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.support.design.widget.AppBarLayout$LayoutParams

LinearLayout parent should be replaced to AppBarLayout!!

#88

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

1 participant