Skip to content

Commit

Permalink
Merge pull request #19 from i906/text-resid
Browse files Browse the repository at this point in the history
Added setText(@resid) methods
  • Loading branch information
wmora committed Nov 21, 2014
2 parents 4bd28c7 + 946aab5 commit 833d452
Showing 1 changed file with 21 additions and 0 deletions.
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 833d452

Please sign in to comment.