Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Toast toast = Toast.makeText(this, content, Toast.LENGTH_SHORT);
- toastView.findViewById(android.R.id.message);
- View toastView = toast.getView();
- Drawable toastBg = toastView.getBackground();
- Drawable drawable = tintDrawable(toastBg, ColorStateList.valueOf(Color.RED));
- toastView.setBackground(drawable);
- toast.setView(toastView);
- toast.show();
- public Drawable tintDrawable(Drawable drawable, ColorStateList colors) {
- final Drawable wrappedDrawable = DrawableCompat.wrap(drawable);
- DrawableCompat.setTintList(wrappedDrawable, colors);
- return wrappedDrawable;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement