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

disable the gradient of the header #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public abstract class FadingActionBarHelperBase {
private View mContentView;
private LayoutInflater mInflater;
private boolean mLightActionBar;
private boolean mActionBarGradient = true;
private boolean mUseParallax = true;
private int mLastDampedScroll;
private int mLastHeaderHeight = -1;
Expand Down Expand Up @@ -105,6 +106,11 @@ public final <T extends FadingActionBarHelperBase> T lightActionBar(boolean valu
return (T)this;
}

public final <T extends FadingActionBarHelperBase> T gradientActionBar(boolean value) {
mActionBarGradient = value;
return (T)this;
}

public final <T extends FadingActionBarHelperBase> T parallax(boolean value) {
mUseParallax = value;
return (T)this;
Expand Down Expand Up @@ -350,6 +356,9 @@ private void updateHeaderHeight(int headerHeight) {

private void initializeGradient(ViewGroup headerContainer) {
View gradientView = headerContainer.findViewById(R.id.fab__gradient);
if(mActionBarGradient == false) {
return;
}
int gradient = R.drawable.fab__gradient;
if (mLightActionBar) {
gradient = R.drawable.fab__gradient_light;
Expand Down