FBToast
Custom toast messages.
- You can create customizable toast messages with FBToast.
- Use FBToast.LENGTH_SHORT or FBToast.LENGTH_LONG for toast display duration.
- You can use Gravity.BOTTOM, Gravity.TOP, Gravity.LEFT or Gravity.RIGHT for toast position on screen.
Native Toast
FBToast.nativeToast(MainActivity.this,"This is Native Toast",FBToast.LENGTH_SHORT);
Success Toast
FBToast.successToast(MainActivity.this,"This is Success Toast",FBToast.LENGTH_SHORT);
Warning Toast
FBToast.warningToast(MainActivity.this,"This is Warning Toast",FBToast.LENGTH_SHORT);
Error Toast
FBToast.errorToast(MainActivity.this,"This is Error Toast",FBToast.LENGTH_SHORT);
Info Toast
FBToast.infoToast(MainActivity.this,"This is Info Toast",FBToast.LENGTH_SHORT);
Custom Toast
FBCustomToast fbCustomToast = new FBCustomToast(MainActivity.this);
fbCustomToast.setMsg("This is Custom Toast");
fbCustomToast.setIcon(ContextCompat.getDrawable(MainActivity.this,R.drawable.ic_android_white_24dp));
fbCustomToast.setBackgroundDrawable(ContextCompat.getDrawable(MainActivity.this,R.drawable.bg_gradient));
fbCustomToast.setTypeface(Typeface.createFromAsset(getAssets(),"font/PoppinsBold.ttf"));
fbCustomToast.show();
Installation
Step 1. Add the JitPack repository to your build file.
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
}