Skip to content

Commit c28b819

Browse files
committed
Updated ok method
Added Iconify parameter
1 parent 8d59c03 commit c28b819

2 files changed

Lines changed: 11 additions & 23 deletions

File tree

.idea/workspace.xml

Lines changed: 6 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/github/pierry/simpletoast/SimpleToast.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ public static void ok(Context context, String msg) {
5151
mytoast.show();
5252
}
5353

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

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

6061
GradientDrawable gradientDrawable = new GradientDrawable();
6162
gradientDrawable.setColor(color);
62-
gradientDrawable.setAlpha(0);
63+
gradientDrawable.setAlpha(100);
6364
gradientDrawable.setCornerRadius(4);
6465
gradientDrawable.setStroke(1, borderColor);
6566

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

7172
IconTextView img = (IconTextView) view.findViewById(R.id.img);
72-
img.setBackground(new IconDrawable(context, Iconify.IconValue.fa_share)
73-
.colorRes(R.color.white));
73+
img.setBackground(new IconDrawable(context, iconValue)
74+
.colorRes(R.color.white).sizeDp(40));
7475

7576
Toast mytoast = new Toast(context);
7677

0 commit comments

Comments
 (0)