Skip to content

Instantly share code, notes, and snippets.

@sreelallalu
Created November 1, 2017 06:36
Show Gist options
  • Select an option

  • Save sreelallalu/85faa83308d9c7dcb9474efddc7de16c to your computer and use it in GitHub Desktop.

Select an option

Save sreelallalu/85faa83308d9c7dcb9474efddc7de16c to your computer and use it in GitHub Desktop.
SnakBarHelper
public class SnakBar {
public static void showsnackbar(Context c,String message, int ID){
try {
Snackbar snackbar = Snackbar
.make(((Activity) c).findViewById(ID), message, Snackbar.LENGTH_SHORT);
View sbView = snackbar.getView();
sbView.setBackgroundColor(c.getResources().getColor(R.color.snakbar));
TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text);
textView.setTextColor(Color.WHITE);
snackbar.show();
}catch (NullPointerException e){e.printStackTrace();}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment