Skip to content

Commit 0d41081

Browse files
committed
Version 1.0.2
1 parent a90c926 commit 0d41081

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1414
You can see all the library releases [here](https://github.com/marcoscgdev/MaterialToast/releases).
1515

@@ -33,33 +33,39 @@ allprojects {
3333
Now 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

4747
Also 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

5353
And 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)

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId "com.marcoscg.materialtoastsample"
1515
minSdkVersion 14
1616
targetSdkVersion 29
17-
versionCode 2
18-
versionName "1.0.1"
17+
versionCode 3
18+
versionName "1.0.2"
1919
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2020
}
2121
buildTypes {

materialtoast/build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ android {
1313
defaultConfig {
1414
minSdkVersion 14
1515
targetSdkVersion 29
16-
versionCode 2
17-
versionName "1.0.1"
18-
16+
versionCode 3
17+
versionName "1.0.2"
1918
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
20-
2119
}
22-
2320
buildTypes {
2421
release {
2522
minifyEnabled false
2623
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2724
}
2825
}
29-
3026
}
3127

3228
dependencies {

0 commit comments

Comments
 (0)