You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`new SToast.Adaptive(context, SToast.SHORT)` the constructor accepts a context and duration.
53
-
You can use `SToast.LONG` for longer duration.
54
-
Available methods:
55
-
-`setIconAndColor(...)` accepting **resource drawable/mipmap** for icon, and **int color** (you can use **Color.NAME** or from resources **getColor(R.color.name)**).
56
-
-`setTitle("title")` to set the title of toast.
57
-
-`setText("some text")` to set the message for the user.
58
-
-`show()` to show the SToast.
59
-
<br/>
51
+
Create Adaptive SToast:
52
+
-`AdaptiveSToast.with(context)` pass a context.
53
+
-`.duration(AdaptiveSToast.LENGTH_LONG)` or `LENGTH_SHORT` (Optional | Default is short).
54
+
-`.icon(iconIntRes, colorInt)`**int resource drawable** for icon, and **int|String color** for icon color (Optional).
55
+
-`.title("title")` to set the title of toast.
56
+
-`.text("some text")` to set the message for the user.
57
+
-`.show()` to show the SToast.
60
58
61
-
> Full Code Example
59
+
Final code:
62
60
```java
63
-
newSToast.Adaptive(this, SToast.LONG)
64
-
.setIconAndColor(R.drawable.ok_img)
65
-
.setTitle("All Ok!")
66
-
.setText("Scanning process completed.")
61
+
AdaptiveSToast.with(this)
62
+
.title("title")
63
+
.text("text")
64
+
65
+
/* for customization
66
+
.icon(R.drawable.icon, getColor(R.color.color)) // or ↓
67
+
OR .icon(R.drawable.icon, "hex color")
68
+
.duration(AdaptiveSToast.LENGTH_LONG)
69
+
*/
70
+
67
71
.show();
68
72
```
69
73
@@ -77,33 +81,27 @@ This is DONE mode
77
81
</p>
78
82
79
83
Create new Mode SToast:
80
-
-`new SToast.Mode(context, SToast.SHORT)` the constructor accepts a context and duration.
81
-
You can use `SToast.LONG` for longer duration.
82
-
Available methods:
83
-
-`setMode(...)` to set the mode you can use
84
-
-**SToast.MODE_OK**
85
-
-**SToast.MODE_DONE**
86
-
-**SToast.MODE_WARN**
87
-
-**SToast.MODE_ERROR**
88
-
-**SToast.MODE_CONFUSE**
89
-
-**SToast.MODE_INFO**
90
-
-**SToast.MODE_HEART**
91
-
-`setTitle("title")` to set the title of toast.
92
-
-`setText("some text")` to set the message for the user.
84
+
-`ModeSToast.with(context)` pass a context.
85
+
-`.mode(...)` to set the mode you can use **ModeSToast.MODE_OK**, **MODE_DONE**, **MODE_WARN**,- **MODE_ERROR**, **MODE_CONFUSE**, **MODE_INFO**, **MODE_HEART**
86
+
-`.duration(ModeSToast.LENGTH_LONG)` or `LENGTH_SHORT` (Optional | Default is short).
87
+
-`.title("title")` to set the title of toast.
88
+
-`.text("some text")` to set the message for the user.
93
89
-`show()` to show the SToast.
90
+
94
91
<br/>
95
92
96
-
> Full Code Example
93
+
Final Code:
97
94
```java
98
-
newSToast.Mode(this, SToast.LONG)
99
-
.setMode(SToast.MODE_HEART)
100
-
.setTitle("Big Love!")
101
-
.setText("Thanks for your donation.")
95
+
ModeSToast(this)
96
+
.mode(ModeSToast.MODE_HEART)
97
+
.title("Big Love!")
98
+
.text("Thanks for your donation.")
102
99
.show();
103
100
```
104
101
105
102
# Usable Resources 🗄
106
-
You can use the drawable resources of this lib in your app!<br>
103
+
You can use the drawables of this lib in your app!<br>
0 commit comments