Last active
August 29, 2015 14:25
-
-
Save n3vr0s/24904290d44e32dc752b to your computer and use it in GitHub Desktop.
Collapsing Toolbar for certain fragments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pl.amstard.goodfood.views; | |
| import android.content.Context; | |
| import android.support.design.widget.CoordinatorLayout; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| public class MyCoordinatorLayout extends CoordinatorLayout { | |
| private boolean allowForScrool = false; | |
| public MyCoordinatorLayout(Context context) { | |
| super(context); | |
| } | |
| public MyCoordinatorLayout(Context context, AttributeSet attrs) { | |
| super(context, attrs); | |
| } | |
| @Override public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) { | |
| return allowForScrool && super.onStartNestedScroll(child, target, nestedScrollAxes); | |
| } | |
| public boolean isAllowForScrool() { | |
| return allowForScrool; | |
| } | |
| public void setAllowForScrool(boolean allowForScrool) { | |
| this.allowForScrool = allowForScrool; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment