Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
dependencies {
...
implementation 'com.github.moekyawsoe:AndLibraryNote:0.1.5'
}
Each method always returns a Toast
object, so you can customize the Toast.
Default Toast from AndLibraryNote:
AndLibraryNote.Toaster(MainActivity.this,"Hello Android Library");
Toasts from MksToast: Default Toast:
public void defaultToast(View view){
MksToast.makeText(MainActivity.this,"This is Default Toast", Toast.LENGTH_LONG,MksToast.Default,true).show();
}
Success Toast:
public void successToast(View view){
MksToast.makeText(MainActivity.this,"This is Success Toast", Toast.LENGTH_LONG,MksToast.SUCCESS,true).show();
}
Info Toast:
public void infoToast(View view){
MksToast.makeText(MainActivity.this,"This is Info Toast", Toast.LENGTH_LONG,MksToast.INFO,true).show();
}
Warning Toast:
public void warningToast(View view){
MksToast.makeText(MainActivity.this,"This is Warning Toast", Toast.LENGTH_LONG,MksToast.WARNING,true).show();
}
Error Toast:
public void errorToast(View view){
MksToast.makeText(MainActivity.this,"This is Error Toast", Toast.LENGTH_LONG,MksToast.ERROR,true).show();
}
Without top-right corner icon
public void CustomToastOne(View view){
MksToast.makeText(MainActivity.this,"This is Toast Withour Corner Icon", Toast.LENGTH_LONG,MksToast.Default,false).show();
}
With custom badge
public void CustomToastTwo(View view){
MksToast.makeText(MainActivity.this,"This is Custom Badge Toast", Toast.LENGTH_LONG, MksToast.INFO,R.drawable.logopng,false).show();
}
With custom badge and custom corner icon
public void CustomToastThree(View view){
MksToast.makeText(MainActivity.this,"This is Custom Badge & Corner icon Toast", Toast.LENGTH_LONG, MksToast.INFO,R.drawable.logopng,R.drawable.logopng).show();
}