Using:
compile \'com.android.support:design:23.0.0\'
compile \'com.android.support:appcompat-v7:23.0.0\'
compile \'com.android.support:cardview-v7:23.0.0\'
c
To implement such behaviour in Cheesesquare example just modify android:layout_height param of the NestedScrollView to wrap_content.
It will prevent scrolling by content if it is small enough to fit on the screen.
And to prevent scrolling by CollapsingToolbarLayout you should programmatically set layout_scrollFlags parameter to the AppBarLayout.LayoutParams.SCROLL_FLAG_SNAP value.
Here described how you can do this.