keyboardsurfer/Crouton — pull request #104 by ataulm (2013-05-03 16:51:07+00:00)
Title: On click dismiss and configuration constructor addition.

Adds an onClick dismiss to the displayed `Crouton` in `Manager#addCroutonToView` (using `Crouton.hide(Crouton)`), regardless of the duration set for display of the Crouton.

There's no visible affordance to indicate it's clickable, but I personally used to tap on Croutons to try to get rid of them, and would suppose others may too.

For some reason, lint flagged up the the `onGlobalLayout()`, so I had to add the `@SuppressLink("NewApi")`.

Added a constructor to `Crouton` which includes a `Configuration` object - `Style` and `Configuration` seem to be hierarchically identical, so it seemed appropriate that if `Style` was a parameter in the constructor, then `Configuration` should be too.

Finally, added a default `Style`, WARN. It's intended to be distinct from ALERT as WARN should convey events that about to/may occur, and ALERT events that have occurred. It seemed like the only missing default `Style`:

- INFO - general information to convey
- CONFIRM - information about a "positive" event or user action
- WARN - pre-error information
- ALERT - error information

The WARN `Style` is accompanied with the holo orange color, and I've added the dark variations of these colors too (from Android API 17, **Colors.xml**) as constants in `Style`.