Skip to content

MohamedNajib/ToastMessag

Repository files navigation

ToastMessag

Custom ToastMessag For Ease use Toast with good view

ToastMessag library


s wiCapturen

How to integrate the ToastMessag library in your app?


Add this in your root build.gradle file
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
For AndroidX Add the dependency in your build.gradle file
  • make sure the version matches the JitPack badge above
dependencies {
        implementation 'com.github.MohamedNajib:ToastMessag:1.1.0'
}
If you still using Android support library in your android apps Add the dependency in your build.gradle file
dependencies {
	implementation 'com.github.MohamedNajib:Support_ToastMessag:1.1.0'
}

Usage


Success Toast:

ToastMessage.setSuccess(yourContext,"Success Toast", ToastMessage.LENGTH_LONG, true).show();

Info Toast:

ToastMessage.setInfo(yourContext, "Info Toast", ToastMessage.LENGTH_SHORT, true).show();

Warning Toast:

ToastMessage.setWarning(yourContext, "Warning Toast", ToastMessage.LENGTH_SHORT, true).show();

Error Toast:

ToastMessage.setError(yourContext, "Error Toast", ToastMessage.LENGTH_SHORT, true).show();

Normal Toast:

ToastMessage.setNormal(yourContext, "Normal Toast", ToastMessage.LENGTH_LONG).show();