#Designed after the docs at Google Material Design
#Features
- Customization including message, action message, action color, action click handle, and animation duration
- Tablet support
- Callbacks for the different SnackBar states (started, actionClicked, finished)
- One Message at a time
- Support for Api version 14+
#Using SnackBar
SnackBar.show(getActivity(), R.string.hello_world);
SnackBar.show(getActivity(), R.string.hello_world, R.string.undo,onClickListener);
#Customization
SnackBarItem sbi = new SnackBarItem.Builder().setMessage("Message")
.setActionMessage("Action")
.setObject(myObject)
.setActionClickListener(myClickListener)
.setActionMessageColor(getResources().getColor(R.color.my_red))
.setActionMessagePressedColor(getResources().getColor(R.color.my_blue))
.setDuration(5000)
.setSnackBarListener(myListener)
.build();
SnackBar.show(getActivity(),sbi);
// Called when the SnackBar begins to animate
@Override
publc void onSnackBarStarted(Object object){
}
// Called when the action button is pressed
@Override
public void onSnackBarAction(Object object){
}
// Called when the SnackBar finishes with its animation
// Will be called if the action button is pressed
@Override
public void onSnackBarFinished(Object object){
}
SnackBar.cancelSnackBars(getActivity());
#Contribution Pull requests are welcomed and encouraged. If you experience any bugs, please file an issue