I am trying to use a Snackbar
. I have a FloatingActionButton
wrapped in a CoordinatorLayout
. When the Snackbar
shows, the
Try this:
Snackbar mysnack = Snackbar.make( fab, "Hi, welcome to my app!", Snackbar.LENGTH_LONG );
mysnack.getView().addOnAttachStateChangeListener( new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow( View v ) {
}
@Override
public void onViewDetachedFromWindow( View v ) {
fab.setTranslationY( 0 );
}
});
mysnack.show();