Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created February 5, 2021 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/fc1c15d758c79523f0e671df7a45c30c to your computer and use it in GitHub Desktop.
Save codeforfun-jp/fc1c15d758c79523f0e671df7a45c30c to your computer and use it in GitHub Desktop.
How to change colors of Snackbar 2
Snackbar.make(view, "ここにメッセージを表示します", Snackbar.LENGTH_SHORT)
.setAction("ボタン", new View.OnClickListener() {
@Override
public void onClick(View v) {
// ボタンを押した時の処理
}
})
.setBackgroundTint(getResources().getColor(R.color.bg_color))
.setTextColor(getResources().getColor(R.color.msg_color))
.setActionTextColor(getResources().getColor(R.color.btn_color))
.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment