Skip to content

Commit

Permalink
Updated ok method
Browse files Browse the repository at this point in the history
Added Iconify parameter
  • Loading branch information
Pierry committed Apr 28, 2015
1 parent 8d59c03 commit c28b819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
25 changes: 6 additions & 19 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ public static void ok(Context context, String msg) {
mytoast.show();
}

@TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void ok(Context context, String msg, int color, int borderColor) {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void ok(Context context, String msg, int color, int borderColor,
Iconify.IconValue iconValue) {
LayoutInflater myInflater = LayoutInflater.from(context);
View view = myInflater.inflate(R.layout.toast_base, null);

LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.layout);

GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(color);
gradientDrawable.setAlpha(0);
gradientDrawable.setAlpha(100);
gradientDrawable.setCornerRadius(4);
gradientDrawable.setStroke(1, borderColor);

Expand All @@ -69,8 +70,8 @@ public static void ok(Context context, String msg) {
button.setText(msg);

IconTextView img = (IconTextView) view.findViewById(R.id.img);
img.setBackground(new IconDrawable(context, Iconify.IconValue.fa_share)
.colorRes(R.color.white));
img.setBackground(new IconDrawable(context, iconValue)
.colorRes(R.color.white).sizeDp(40));

Toast mytoast = new Toast(context);

Expand Down

0 comments on commit c28b819

Please sign in to comment.