Releases: nispok/snackbar
Bug fixing + resources refactor
- Added "sb__" prefix to all resources that were missing it
- Fixed NPE when attempting to recycle the velocity tracker used when swiping (#49)
SnackbarManager
A SnackbarManager is now included with the lib to handle multiple Snackbar messages. See the updated README for usage
Add bottom margin if content is fitting system UI
Snackbars were not being properly shown with transparent nav bars (KitKat and up). See #41
Bug fixes
Getters for animation resources
Included static getters for animation resources. In that way, clients can apply the same animation or if the exact same animation does not work depending on the use case, they can query the specific fields they need.
The getters are Snackbar.getInAnimationResource()
and Snackbar.getOutAnimationResource()
.
The getter getAnimationDuration()
has now been deprecated. You should query that directly from the resource
EventListener extended
- EventListener now has two new events:
onShown()
andonDismissed()
. This way you have control over the whole animation cycle. Note that now each event will receive theSnackbar
instance instead of just the height, so you will have to modify your code if updating from a previous version - Fixed the min/max width and offset for the tablet layout
- Removed bold style from action button
Support for APIs >= Froyo
The minSDK version of the library has been lowered to 8.
Note that any apps running on APIs < 11 will not have the swipe-to-dismiss functionality. Enabling it explicitly won't have any effect.
Snackbar is always brought as parent's top view
Tablet support
- Reintroduced tablet support, initially introduced with #7. When Inbox was released, the Snackbars used in there did not follow the specs from the guidelines for tablets, so the initial implementation was dropped
- Single-line snackbars are now 48dp tall as specified in the guidelines. The padding was left a bit different, however: 14dp at the top and 14dp at the bottom vs 16dp/12dp in the specs