Skip to content

Commit

Permalink
[AppBarLayout] Add setLiftOnScrollTargetView() method
Browse files Browse the repository at this point in the history
Resolves #2544

PiperOrigin-RevId: 442823082
  • Loading branch information
dsn5ft committed Apr 19, 2022
1 parent 824a12b commit d6c4354
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/java/com/google/android/material/appbar/AppBarLayout.java
Expand Up @@ -967,6 +967,19 @@ public boolean isLiftOnScroll() {
return liftOnScroll;
}

/**
* Sets the view that the {@link AppBarLayout} should use to determine whether it should be
* lifted.
*/
public void setLiftOnScrollTargetView(@Nullable View liftOnScrollTargetView) {
this.liftOnScrollTargetViewId = View.NO_ID;
if (liftOnScrollTargetView == null) {
clearLiftOnScrollTargetView();
} else {
this.liftOnScrollTargetView = new WeakReference<>(liftOnScrollTargetView);
}
}

/**
* Sets the id of the view that the {@link AppBarLayout} should use to determine whether it should
* be lifted.
Expand Down

0 comments on commit d6c4354

Please sign in to comment.