A fully and highly customizable material designed Toast for Android.
Clone or download
Latest commit 9da8d48 Dec 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Different text size for lollipop and pre-lollipop Dec 24, 2018
app Version 1.0.1 Dec 24, 2018
gradle/wrapper Initial version Dec 22, 2018
materialtoast Version 1.0.1 Dec 24, 2018
.gitignore Initial version Dec 22, 2018
LICENSE Create LICENSE Dec 22, 2018
README.md Update README.md Dec 24, 2018
build.gradle Initial version Dec 22, 2018
device-2018-12-22-164932.png Initial version Dec 22, 2018
gradle.properties Initial version Dec 22, 2018
gradlew Initial version Dec 22, 2018
gradlew.bat Initial version Dec 22, 2018
settings.gradle Initial version Dec 22, 2018

README.md

MaterialToast

A fully and highly customizable material designed Toast for Android.

You can download the sample apk here.


Releases:

Current release: 1.0.1.

You can see all the library releases here.


Usage:

Adding the depencency

Add this to your root build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Now add the dependency to your app build.gradle file:

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

Creating a Toast

  • Native version
MaterialToast.makeText(this, "Hello, I'm a material toast!", Toast.LENGTH_SHORT).show();

Also with custom icon

MaterialToast.makeText(this, "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)

MaterialToast.makeText(this, "Hello, I'm a material toast!", R.mipmap.ic_launcher, Toast.LENGTH_SHORT).setBackgroundColor(Color.RED).show();
  • Complete version
new MaterialToast(this)
       .setMessage("Hello, I'm a material toast!")
       .setIcon(R.mipmap.ic_launcher)
       .setDuration(Toast.LENGTH_SHORT)
       .setBackgroundColor(Color.RED)
       .show();

See the sample project to clarify any queries you may have.


License

Copyright 2018 Marcos Calvo García

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.