I have a TextInputEditText inside a TextInputLayout. I want to change the TextInputLayout's background based on whether the EditText has focus or not. I can easily accomplish that by observing the edittext's focus from the activity and then update the background accordingly. But it seems such a waste to update the element from the activity if I'm already using Data Binding. Is there a way to reference the TextInputLayout's background from the focus change callback inside the EditText?
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/input_field_unselected_background">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:inputType="text"
android:hint="@string/hint_placeholder"
android:background="@android:color/transparent"/>
</com.google.android.material.textfield.TextInputLayout>