From 4bd28c7d0ac3373bcc92a199201fb742a01e9d1e Mon Sep 17 00:00:00 2001 From: William Mora Date: Thu, 20 Nov 2014 20:19:42 -0300 Subject: [PATCH 1/2] email syntax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc9c660..32c9212 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Snackbar.with(SnackbarSampleActivity.this) // context If you would like to add features to it or report any bugs, refer to the [issues](https://github.com/nispok/snackbar/issues) section.

# Who's using Snackbar? -If you are using this library and would like to be mentioned here, open a PR or tell us via [email](contact@nispok.com). +If you are using this library and would like to be mentioned here, open a PR or tell us via [email](mailto:contact@nispok.com). # Examples There's a sample app included in the project. [SnackbarSampleActivity](./sample/src/main/java/com/nispok/sample/snackbar/SnackbarSampleActivity.java) is where you want to start. From 946aab548cb39498facda9fa22d8e264966e26b2 Mon Sep 17 00:00:00 2001 From: Noorzaini Ilhami Date: Fri, 21 Nov 2014 12:31:53 +0800 Subject: [PATCH 2/2] Added setText(@resId) methods --- .../java/com/nispok/snackbar/Snackbar.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/src/main/java/com/nispok/snackbar/Snackbar.java b/lib/src/main/java/com/nispok/snackbar/Snackbar.java index bc2608e..a5c811e 100644 --- a/lib/src/main/java/com/nispok/snackbar/Snackbar.java +++ b/lib/src/main/java/com/nispok/snackbar/Snackbar.java @@ -94,6 +94,16 @@ public Snackbar text(CharSequence text) { return this; } + /** + * Sets the text to be displayed in this {@link Snackbar} + * + * @param resId + * @return + */ + public Snackbar text(int resId) { + return text(getContext().getText(resId)); + } + /** * Sets the background color of this {@link Snackbar} * @@ -128,6 +138,17 @@ public Snackbar actionLabel(CharSequence actionButtonLabel) { return this; } + /** + * Sets the action label to be displayed, if any. Note that if this is not set, the action + * button will not be displayed + * + * @param resId + * @return + */ + public Snackbar actionLabel(int resId) { + return actionLabel(getContext().getString(resId)); + } + /** * Sets the color of the action button label. Note that you must set a button label with * {@link Snackbar#actionLabel(CharSequence)} for this button to be displayed