Skip to content

Commit d6c4354

Browse files
committedApr 19, 2022
[AppBarLayout] Add setLiftOnScrollTargetView() method
Resolves #2544 PiperOrigin-RevId: 442823082
1 parent 824a12b commit d6c4354

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎lib/java/com/google/android/material/appbar/AppBarLayout.java

+13
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,19 @@ public boolean isLiftOnScroll() {
967967
return liftOnScroll;
968968
}
969969

970+
/**
971+
* Sets the view that the {@link AppBarLayout} should use to determine whether it should be
972+
* lifted.
973+
*/
974+
public void setLiftOnScrollTargetView(@Nullable View liftOnScrollTargetView) {
975+
this.liftOnScrollTargetViewId = View.NO_ID;
976+
if (liftOnScrollTargetView == null) {
977+
clearLiftOnScrollTargetView();
978+
} else {
979+
this.liftOnScrollTargetView = new WeakReference<>(liftOnScrollTargetView);
980+
}
981+
}
982+
970983
/**
971984
* Sets the id of the view that the {@link AppBarLayout} should use to determine whether it should
972985
* be lifted.

0 commit comments

Comments
 (0)
Please sign in to comment.