Skip to content

Commit 3f2d205

Browse files
gsajithikim24
authored andcommitted
Log a warning rather than an info when setting background on a MaterialButton.
PiperOrigin-RevId: 239880506
1 parent 5aebe1a commit 3f2d205

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/java/com/google/android/material/button/MaterialButton.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ public void setBackgroundResource(@DrawableRes int backgroundResourceId) {
351351
public void setBackgroundDrawable(Drawable background) {
352352
if (isUsingOriginalBackground()) {
353353
if (background != this.getBackground()) {
354-
Log.i(LOG_TAG, "Setting a custom background is not supported.");
354+
Log.w(
355+
LOG_TAG,
356+
"Do not set the background; MaterialButton manages its own background drawable.");
355357
materialButtonHelper.setBackgroundOverwritten();
356358
super.setBackgroundDrawable(background);
357359
} else {

0 commit comments

Comments
 (0)