collapse

@CanIgnoreReturnValue
open fun collapse(@NonNull expandedView: View): Boolean
@CanIgnoreReturnValue
open fun collapse(@NonNull expandedView: View, @Nullable appBarLayout: AppBarLayout): Boolean

See collapse.


@CanIgnoreReturnValue
open fun collapse(@NonNull expandedView: View, @Nullable appBarLayout: AppBarLayout, skipAnimation: Boolean): Boolean

Starts a collapse animation, if it's not already started, which transitions from the expandedView, e.g., a contextual Toolbar, to the SearchBar.

Note: If you are using an AppBarLayout in conjunction with the SearchBar, you may pass in a reference to your AppBarLayout so that its visibility and offset can be taken into account for the animation.

Return

whether or not the collapse animation was started