CustomToast

Additional

Language
Java
Version
1.0.2 (Jan 26, 2018)
Created
Jan 26, 2018
Updated
Feb 4, 2018
Owner
shelake-chetan
Contributor
shelake-chetan
1
Activity
Badge
Generate
Download
Source code

Advertisement

CustomToast

Step 1. Add the JitPack repository to your build file

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

Step 2. Add the dependency in build.gradle file

dependencies { compile 'com.github.shelake-chetan:CustomToast:1.0.2' }

Step 3. Initialise Custom Toast first

    private CustomToast customToast;
    customToast = new CustomToast(this); //pass context as parameter
                                   customToast.setTextColor(context.getResources().getColor(R.color.white));
    customToast.setBackground(context.getResources().getColor(R.color.app_color));

Step 4. Show toast as error,success or network error

   customToast.showErrorToast("Some error occurred, please try again");

   customToast.showNetworkToast();

   customToast.showSuccessToast("I have successfully registered my interest");