Skip to content

Poriazy/GradyToast-Android

Repository files navigation

GradyToast-Android

Toast with gradients.

🛠 Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

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

🛠 Dependency

Add this to your module's build.gradle file:

dependencies {
	...
	implementation 'com.github.Poriazy:GradyToast-Android:1.0'
}

📱 Screenshots

enlarge photo by click on it.


🤔 How to use

Create Object of GradyToast:

GradyToast gradyToast = new GradyToast(yourContext);

// or
GradyToast gradyToast = new GradyToast();
gradyToast.with(yourContext);

// or use the other constructors

🎨 Types

You Can change GradyToast appearance with these types:

public enum GradyType {
    PRIMARY,
    SUCCESS,
    ERROR,
    WARNING,
    INFO,
    LIGHT,
    DARK,
    CUSTOM,
}

Sample:

gradyToast
	.with(yourContext)
	.setText("HelloWorld!")
	.setType(GradyType.SUCCESS);

You can also create your custom Toasts with the .setType(GradyType.CUSTOM),method:

GradyToast myCustomGrady = new GradyToast();
myCustomGrady
	.with(yourContext)
	.setText("Your Toast Message")
	.setDuration(GradyDuration.LONG)
	.setTextSize(24)
	.setType(GradyType.CUSTOM)
	.setTextColor("#bdc3c7")
	.setCustomColors("#FF0099", "#493240", "#000000" )
	.setGradyStrokeSize(3)
	.show();

ℹ Info & Simple usage:

GradyToast simpleGrady = new GradyToast(yourContext);
simpleGrady.setText("Hello World!");
/*
 * Defaults:
 *		tostDuration -> GradyDuration.SHORT 
 *		tostSyle -> GradyType.PRIMARY
 *
 */