If your toolbar is inside AppBarLayout, you can use the setExpanded AppBarLayout method to expand and smooth the toolbar with or without animation.
setExpanded(boolean expanded, boolean animate)
This method is available from the v23 support library.
From the documentation for reference.
As with scrolling through an AppBarLayout, this method relies on this layout, which is a direct child of the CoordinatorLayout.
expand: true if the layout should be fully expanded, false if it should be fully compensated
animate: whether to animate a new state
AppBarLayout appBarLayout = (AppBarLayout)findViewById(R.id.appBar);
to expand the toolbar using animation.
appBarLayout.setExpanded(true, true);
to collapse the toolbar using animation.
appBarLayout.setExpanded(false, true);
source share