Created
November 1, 2017 06:36
-
-
Save sreelallalu/85faa83308d9c7dcb9474efddc7de16c to your computer and use it in GitHub Desktop.
SnakBarHelper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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