SnackbarBuilder Versions Save

[ARCHIVED] Builder pattern for support library Snackbars, that makes them easier to customise and use

v0.9.0

6 years ago

Changes

  • SnackbarBuilder will no longer set any default colours for the message and the action. The only way these colours will change from the Snackbar's defaults are through you providing theme attributes or calling the builder methods.

API Changes

  • Updated SnackbarBuilder to set case of action text using method matching TextView. On API 14 and above action is all caps by default, by passing false to this method the action will use the case of the string you set.
    • lowercaseAction -> actionAllCaps(false)
  • Updated SnackbarWrapper to set case of action text using single method (matching TextView).
    • setLowercaseActionText -> setAllCapsActionText(false)
    • setUppercaseActionText -> setAllCapsActionText(true)
  • Added SnackbarWrapper.addCallbacks to specify a list of callbacks.
  • Fixed the icon margin setters in SnackbarWrapper
    • setIconMarginPixels -> setIconMargin
    • setIconMargin -> setIconMarginRes

Dependencies

  • Updated Android support library to v25.4.0

v0.8.0

7 years ago

Fixes

  • Icon support fixed after changes in support library.

Features

  • SnackbarWrapper.removeCallback has been added.
  • Default icon margin can be set through theme attribute.
  • Actions can be forced to lowercase by default through a theme attribute.

API Changes

  • You can no longer set start and end icon margin. Instead you can just set margin between the icon and Snackbar message. This is set with either iconMargin or iconMarginRes on SnackbarBuilder.
  • Icon now has to be implemented using compound drawable on a TextView, which means AppCompat vector drawables no longer supported - until they are supported by AppCompat.
  • SnackbarCombinedCallback removed as its no longer needed now that multiple callbacks can be added to a Snackbar.
  • SnackbarWrapper.setCallback -> SnackbarWrapper.addCallback as setCallback was deprecated on the Snackbar class.

Dependencies

  • Updated Android support library to v25.3.0

v0.7.0

7 years ago

Fixes

  • Removed marking of public resources, as it was causing all resources in dependenices (such as AppCompat) as private. Will put it back once this problem has been fixed within the build tools.

Dependencies

  • Updated to target API 25
  • Updated Android support library to v25.0.0

v0.6.0

7 years ago

Features

  • New constructor that takes a SnackbarParentFinder, which is used to look for a parent view to attach to - allowing fallback parent views when one is not found.
  • Separate callback interfaces rather than needing to override a single class to handle all the different callbacks. E.g. SnackbarShowCallback and SnackbarSwipeDismissCallback.

API Changes

  • SnackbarBuilder.iconMarginStartPixels -> iconMarginStart
  • SnackbarBuilder.iconMarginStart -> iconMarginStartRes
  • SnackbarBuilder.iconMarginEndPixels -> iconMarginEnd
  • SnackbarBuilder.iconMarginEnd -> iconMarginEndRes

Improvements

  • Removed logging from SnackbarCallback.
  • Added code quality checks: CheckStyle, FindBugs and PMD.
  • Reformatted whole project code style.
  • Improved JavaDocs.

Dependencies

  • Updated to target API 24
  • Updated Android support library to v24.1.1

v0.5.0

8 years ago

Features

  • Append messages to the end of the main Snackbar messages. Each of these appended messages can have a different colour specified.
  • Add an icon to the Snackbar.
  • Added a SnackbarWrapper, to allow you to customise the Snackbar after it has been created.

API Changes

  • Builder methods which take a String now take a CharSequence, so will honour any spans that have been applied already.
  • Rather than providing styling through single theme attributes, you assign a whole style to the theme attributes snackbarBuilderStyle and toastBuilderStyle. This cleans up your theme and is a bit easier as you can extend the built-in SnackbarBuilder style.
  • Moved the ToastBuilder to be within the snackbarbuilder package, to ensure the whole library is within a single base package.

Improvements

  • Added JavaDoc comments to the full public API.
  • Added more samples.

v0.4

8 years ago
  • Added ToastBuilder for display Toast messages
  • Added SnackbarCallbackWrapper for more control over your callbacks and to easily wrap existing callbacks
  • Specify custom Snackbar duration through a global theme attribute

v0.3

8 years ago
  • Updated dependencies
  • Fix problems that were caused by using ThemeUtils class

v0.2

8 years ago

This is the first usable version of the library.

It is working and is fully covered with tests. The reason for the v0.2, is just to make sure it has all the features that will be required by real projects. Once it has been used by some projects and any required features are added, a version 1 will be released.