Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nispok/snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
William Mora committed Nov 23, 2014
2 parents a74b370 + 833d452 commit 71ee179
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,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.<br /><br />

# 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]([email protected]).
If you are using this library and would like to be mentioned here, open a PR or tell us via [email](mailto:[email protected]).

# 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.
Expand Down
21 changes: 21 additions & 0 deletions lib/src/main/java/com/nispok/snackbar/Snackbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 71ee179

Please sign in to comment.