@@ -3,13 +3,13 @@ A fully and highly customizable material designed Toast for Android.
33
44<img src =" https://raw.githubusercontent.com/marcoscgdev/MaterialToast/master/device-2018-12-22-164932.png " width =" 350 " >
55
6- You can download the ** sample apk** [ here] ( https://github.com/marcoscgdev/MaterialToast/releases/download/1.0.1 /app-debug.apk ) .
6+ You can download the ** sample apk** [ here] ( https://github.com/marcoscgdev/MaterialToast/releases/download/1.0.2 /app-debug.apk ) .
77
88---
99
1010## Releases:
1111
12- #### Current release: 1.0.1 .
12+ #### Current release: 1.0.2 .
1313
1414You can see all the library releases [ here] ( https://github.com/marcoscgdev/MaterialToast/releases ) .
1515
@@ -33,33 +33,39 @@ allprojects {
3333Now add the dependency to your app build.gradle file:
3434
3535```
36- implementation 'com.github.marcoscgdev:MaterialToast:1.0.1 '
36+ implementation 'com.github.marcoscgdev:MaterialToast:1.0.2 '
3737```
3838
3939### Creating a Toast
4040
4141 - Native version
4242
4343``` java
44- MaterialToast . makeText(this , " Hello, I'm a material toast!" , Toast . LENGTH_SHORT ). show();
44+ MaterialToast . makeText(activity , " Hello, I'm a material toast!" , Toast . LENGTH_SHORT ). show();
4545```
4646
4747Also with custom icon
4848
4949``` java
50- MaterialToast . makeText(this , " Hello, I'm a material toast!" , R . mipmap. ic_launcher, Toast . LENGTH_SHORT ). show();
50+ MaterialToast . makeText(activity , " Hello, I'm a material toast!" , R . mipmap. ic_launcher, Toast . LENGTH_SHORT ). show();
5151```
5252
5353And also with custom background color (text will be automatically colored based on background color)
5454
5555``` java
56- MaterialToast . makeText(this , " Hello, I'm a material toast!" , R . mipmap. ic_launcher, Toast . LENGTH_SHORT ). setBackgroundColor(Color . RED ). show();
56+ MaterialToast . makeText(activity, " Hello, I'm a material toast!" , R . mipmap. ic_launcher, Toast . LENGTH_SHORT ). setBackgroundColor(Color . RED ). show();
57+ ```
58+
59+ ** NEW!** With custom duration (in millis):
60+
61+ ``` java
62+ MaterialToast . makeText(activity, " Hello, I'm a material toast!" , R . mipmap. ic_launcher, 4000 ). setBackgroundColor(Color . RED ). show();
5763```
5864
5965 - Complete version
6066
6167 ``` java
62- new MaterialToast (this )
68+ new MaterialToast (activity )
6369 .setMessage(" Hello, I'm a material toast!" )
6470 .setIcon(R . mipmap. ic_launcher)
6571 .setDuration(Toast . LENGTH_SHORT )
0 commit comments