Created
January 6, 2016 20:40
-
-
Save darland6/9c27406c38feba63f5b7 to your computer and use it in GitHub Desktop.
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
| //generate the snackbar | |
| Snackbar sb = Snackbar.make(rootView, snack.text, duration); | |
| //set te action button text color | |
| sb.setActionTextColor(mCurrentActivity.getResources().getColor(R.color.snack_text_action)); | |
| //Get the view of the snackbar | |
| View sbView = sb.getView(); | |
| //set background color | |
| sbView.setBackgroundColor(mCurrentActivity.getResources().getColor(backgroudResId)); | |
| //Get the textview of the snackbar text | |
| TextView textView = (TextView) sbView.findViewById(android.support.design.R.id.snackbar_text); | |
| //set text color | |
| textView.setTextColor(mCurrentActivity.getResources().getColor(R.color.snack_text)); | |
| //increase max lines of text in snackbar. default is 2. | |
| textView.setMaxLines(10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment