diff --git a/app/src/main/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdapters.java b/app/src/main/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdapters.java index b704faa86e2..4e7f59b0bb3 100644 --- a/app/src/main/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdapters.java +++ b/app/src/main/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdapters.java @@ -4,6 +4,7 @@ import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.appcompat.widget.AppCompatCheckBox; +import androidx.core.widget.CompoundButtonCompat; import androidx.databinding.BindingAdapter; /** @@ -13,6 +14,6 @@ public final class AppCompatCheckBoxBindingAdapters { /** Sets the button tint for the specified checkbox, via data-binding. */ @BindingAdapter("app:buttonTint") public static void setButtonTint(@NonNull AppCompatCheckBox checkBox, @ColorInt int colorRgb) { - checkBox.setSupportButtonTintList(ColorStateList.valueOf(colorRgb)); + CompoundButtonCompat.setButtonTintList(checkBox, ColorStateList.valueOf(colorRgb)); } } diff --git a/app/src/sharedTest/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdaptersTest.kt b/app/src/sharedTest/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdaptersTest.kt index 57586237166..9fcf2bd1e47 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdaptersTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdaptersTest.kt @@ -127,7 +127,7 @@ class AppCompatCheckBoxBindingAdaptersTest { activityRule.scenario.onActivity { val appCompatCheckBox: AppCompatCheckBox = getAppCompatCheckBox(it) setButtonTint(appCompatCheckBox, colorRgb) - assertThat(appCompatCheckBox.supportButtonTintList?.defaultColor).isEqualTo(colorRgb) + assertThat(appCompatCheckBox.buttonTintList?.defaultColor).isEqualTo(colorRgb) } }