Restaurant SnackBar

Features


Min SDK : 15
Price : Free
Language : Java

 

Download


Link : Github
Owner : SandroMachado
Source Code : Download

 

An extension to the Snackbar view available at the Android Design Support Library.

Restaurant wraps the Snackbar implementation to easily allow more customization. With Restaurant you can change the text and background color of the Snackbar just calling a method. Restaurant can also detect the correct view to attach the Snackbar just receiving the activity.

Gradle Dependency

Repository

First, add the following to your app’s build.gradle file:

repositories {
maven { url "https://jitpack.io" }
}

 

Them include the Restaurant dependency:

dependencies {
// ... other dependencies here.
// Set the transitive = false if you already have the Design Support Library dependency.
compile('com.github.SandroMachado:restaurant:[email protected]') {
transitive = true
}
}

 

Usage

Show a Snackbar with a custom background color:

new Restaurant(MainActivity.this, "Snackbar with custom background color", Snackbar.LENGTH_LONG)
.setBackgroundColor(Color.GRAY)
.show();

 

Show a Snackbar with a custom text color:

new Restaurant(MainActivity.this, "Snackbar with custom text color", Snackbar.LENGTH_LONG)
.setTextColor(Color.GREEN)
.show();

 

Show a Snackbar with a custom text colors:

new Restaurant(MainActivity.this, "", Snackbar.LENGTH_LONG)
.appendText("RED", Color.RED)
.appendText("GREEN", Color.GREEN)
.appendText("BLUE", Color.BLUE)
.appendText("WHITE", Color.WHITE)
.show();

 

Show a custom Snackbar:

new Restaurant(MainActivity.this, "Snackbar with custom background and text color", Snackbar.LENGTH_LONG)
.setBackgroundColor(Color.GRAY)
.setTextColor(Color.GREEN)
.show();