mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 23:29:52 +01:00
use default snackbar colors until specified otherwise
This commit is contained in:
@@ -18,7 +18,8 @@ import static androidx.core.content.ContextCompat.getColor;
|
|||||||
public class BriarSnackbarBuilder {
|
public class BriarSnackbarBuilder {
|
||||||
|
|
||||||
@ColorRes
|
@ColorRes
|
||||||
private int backgroundResId = R.color.briar_primary;
|
@Nullable
|
||||||
|
private Integer backgroundResId = null;
|
||||||
@StringRes
|
@StringRes
|
||||||
private int actionResId;
|
private int actionResId;
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -26,9 +27,11 @@ public class BriarSnackbarBuilder {
|
|||||||
|
|
||||||
public Snackbar make(View view, CharSequence text, int duration) {
|
public Snackbar make(View view, CharSequence text, int duration) {
|
||||||
Snackbar s = Snackbar.make(view, text, duration);
|
Snackbar s = Snackbar.make(view, text, duration);
|
||||||
s.setBackgroundTint(getColor(view.getContext(), backgroundResId));
|
if (backgroundResId != null) {
|
||||||
s.setTextColor(
|
s.setBackgroundTint(getColor(view.getContext(), backgroundResId));
|
||||||
getColor(view.getContext(), R.color.md_theme_onSecondary));
|
s.setTextColor(
|
||||||
|
getColor(view.getContext(), R.color.md_theme_onSecondary));
|
||||||
|
}
|
||||||
if (onClickListener != null) {
|
if (onClickListener != null) {
|
||||||
s.setActionTextColor(getColor(view.getContext(),
|
s.setActionTextColor(getColor(view.getContext(),
|
||||||
R.color.briar_button_text_positive));
|
R.color.briar_button_text_positive));
|
||||||
|
|||||||
Reference in New Issue
Block a user