SunJenry / EasySnackBar

A SnackBar can show at top and bottom with a custom layout.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EasySnackBar

A SnackBar can show at top and bottom with a custom layout.

This a SnackBar focuse on show custom layout,so it will not provide the same interface as the Google'Snackbar.

Notice

This Snackbar must be used in same environment as the google's Snackbar, otherwise it will show in wrong case. For example, it's should be shown in a CoordinatorLayout.

The effect show as the GIF below

demo

Usage

  1. Adding dependencies
dependencies {
    compile 'com.sun.easysnackbar:easysnackbar:1.0.1'
    ...
}
  1. Use in your code
 // Must create custom view in this way,so it can display normally
 View contentView = EasySnackBar.convertToContentView(mView, R.layout.layout_custom);
 // true represent show at top,false at bottom
 EasySnackBar.make(mView, contentView, EasySnackBar.LENGTH_SHORT, true).show();

About

A SnackBar can show at top and bottom with a custom layout.

License:Apache License 2.0


Languages

Language:Java 100.0%