KSnack

Project Url: onurkagan/KSnack
Introduction: Customizable snackbar messages.
More: Author   ReportBugs   
Tags:

You can create customized Snackbar with KSnack. KSnack has 2 view type; KSnack and Minimal KSnack.

Minimal KSnack

  1. Initialize Minimal KSnack.
    MinimalKSnack minimalKSnack = new MinimalKSnack(MainActivity.this);
    
  2. Set Features. Styles; *STYLE_DEFAULT,
                       `STYLE_INFO`, 
                       `STYLE_SUCCESS`, 
                       `STYLE_ERROR`, 
                       `STYLE_WARNING`*
    
    minimalKSnack
     .setMessage("This is minimal KSnack !") // message
     .setStyle(MinimalKSnackStyle.STYLE_SUCCESS) // style
     .setBackgroundColor(R.color.colorGray) // background color
     .setBackgrounDrawable(R.drawable.background_ex_one) // background drawable
     .setAnimation(Fade.In.getAnimation(), Fade.Out.getAnimation()) // show and hide animations
     .setDuration(4000) // you can use for auto close.
     .show();
    
  3. Close Minimal KSnack.
    minimalKSnack.dismiss();
    

KSnack

  1. Initialize KSnack.
    KSnack kSnack = new KSnack(MainActivity.this);
    
  2. Set Features.

    kSnack
    .setListener(new KSnackBarEventListener() { // listener
       @Override
       public void showedSnackBar() {
           System.out.println("Showed");
       }
    
       @Override
       public void stoppedSnackBar() {
           System.out.println("Stopped");
       }
    })
    .setAction("Text", new View.OnClickListener() { // name and clicklistener
       @Override
       public void onClick(View v) {
           System.out.println("Your action !");
       }
    })
    .setMessage("Your message.") // message
    .setTextColor(R.color.white) // message text color
    .setBackColor(R.color.colorGray) // background color
    .setButtonTextColor(R.color.white) // action button text color
    .setBackgrounDrawable(R.drawable.background_ex_one) // background drawable
    .setAnimation(Fade.In.getAnimation(), Fade.Out.getAnimation()) // show and hide animations
    .setDuration(4000) // you can use for auto close.
    .show();
    
  3. Close Minimal KSnack.
    kSnack.dismiss();
    

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.onurkagan:KSnack:1.0.2'
}
Support Me
Apps
About Me
Google+: Trinea trinea
GitHub: Trinea