Agus_Darmawan

showSnackbar

Feb 21st, 2021 (edited)
1,049
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. /*
  2.     <color name="red">#F11515</color>
  3.     <color name="intelliJ">#302525</color>
  4.      */
  5.     private void showSnackbar(String message, boolean warnNotif) {
  6.         int colorId = R.color.intelliJ;
  7.         if (warnNotif) {
  8.             colorId = R.color.red;
  9.         }
  10.         Snackbar.make(findViewById(android.R.id.content), message, Snackbar.LENGTH_LONG)
  11.                 .setBackgroundTint(getResources().getColor(colorId))
  12.                 .show();
  13.     }
Add Comment
Please, Sign In to add comment