Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscgdev committed Dec 3, 2020
1 parent a90c926 commit 0d41081
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ A fully and highly customizable material designed Toast for Android.

<img src="https://raw.githubusercontent.com/marcoscgdev/MaterialToast/master/device-2018-12-22-164932.png" width="350">

You can download the **sample apk** [here](/~https://github.com/marcoscgdev/MaterialToast/releases/download/1.0.1/app-debug.apk).
You can download the **sample apk** [here](/~https://github.com/marcoscgdev/MaterialToast/releases/download/1.0.2/app-debug.apk).

---

## Releases:

#### Current release: 1.0.1.
#### Current release: 1.0.2.

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

Expand All @@ -33,33 +33,39 @@ allprojects {
Now add the dependency to your app build.gradle file:

```
implementation 'com.github.marcoscgdev:MaterialToast:1.0.1'
implementation 'com.github.marcoscgdev:MaterialToast:1.0.2'
```

### Creating a Toast

- Native version

```java
MaterialToast.makeText(this, "Hello, I'm a material toast!", Toast.LENGTH_SHORT).show();
MaterialToast.makeText(activity, "Hello, I'm a material toast!", Toast.LENGTH_SHORT).show();
```

Also with custom icon

```java
MaterialToast.makeText(this, "Hello, I'm a material toast!", R.mipmap.ic_launcher, Toast.LENGTH_SHORT).show();
MaterialToast.makeText(activity, "Hello, I'm a material toast!", R.mipmap.ic_launcher, Toast.LENGTH_SHORT).show();
```

And also with custom background color (text will be automatically colored based on background color)

```java
MaterialToast.makeText(this, "Hello, I'm a material toast!", R.mipmap.ic_launcher, Toast.LENGTH_SHORT).setBackgroundColor(Color.RED).show();
MaterialToast.makeText(activity, "Hello, I'm a material toast!", R.mipmap.ic_launcher, Toast.LENGTH_SHORT).setBackgroundColor(Color.RED).show();
```

**NEW!** With custom duration (in millis):

```java
MaterialToast.makeText(activity, "Hello, I'm a material toast!", R.mipmap.ic_launcher, 4000).setBackgroundColor(Color.RED).show();
```

- Complete version

```java
new MaterialToast(this)
new MaterialToast(activity)
.setMessage("Hello, I'm a material toast!")
.setIcon(R.mipmap.ic_launcher)
.setDuration(Toast.LENGTH_SHORT)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.marcoscg.materialtoastsample"
minSdkVersion 14
targetSdkVersion 29
versionCode 2
versionName "1.0.1"
versionCode 3
versionName "1.0.2"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down
8 changes: 2 additions & 6 deletions materialtoast/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 29
versionCode 2
versionName "1.0.1"

versionCode 3
versionName "1.0.2"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
Expand Down

0 comments on commit 0d41081

Please sign in to comment.