Skip to content

joaogarrido98/tostada

Repository files navigation

Tostada

License

This is a library that works both with kotlin and java.

Toast for everyone, you want jelly you got it, you want peanut butter, you got it.

Before you start

Add to your settings.gradle file

dependencyResolutionManagement {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Dependencies

Add to your build.gradle module

dependencies {
	...
	implementation 'com.github.joaogarrido98:tostada:1.2.2'
}

Usage

This is a step by step of how to use it.

Time can be either

Tostas.FAST

or

Tostas.SLOW

Kotlin

Display an information Toast:

Tostas.info(this, "This is an information", Tostas.SLOW)

Display an error Toast:

Tostas.error(this, "This is an error", Tostas.SLOW)

Display an success Toast:

Tostas.success(this, "This is a success", Tostas.SLOW)

Display an warn Toast:

Tostas.warn(this, "This is a warning", Tostas.SLOW)

Display a neutral Toast:

Tostas.neutral(this, "This is a neutral", Tostas.SLOW)

Display a custom Toast:

val d = AppCompatResources.getDrawable(this, R.drawable.pink_stuff)
Tostas.custom(this, "Custom Toast", Tostas.SLOW, d!!, "#FF69B4")

Java

Display an information Toast:

Tostas.info(Activity.this, "This is an information", Tostas.FAST);

Display an error Toast:

Tostas.error(Activity.this, "This is an error", Tostas.FAST);

Display an success Toast:

Tostas.success(Activity.this, "This is a success", Tostas.FAST);

Display an warn Toast:

Tostas.warn(Activity.this, "This is a warning", Tostas.FAST);

Display a neutral Toast:

Tostas.neutral(Activity.this, "This is a neutral", Tostas.FAST);

Display a custom Toast:

Drawable d = AppCompatResources.getDrawable(getActivity(), R.drawable.pink_stuff)
Tostas.custom(Activity.this, "Custom Toast", Tostas.FAST, d, "#FF69B4");

About

Easy toasts for everyone!

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages