Get start and end icon view from TextInputLayout

156 Views Asked by At

I want to get the end and start icon view from TextInputLayout so I can do stuff like check if it is hovered or not.

I don't know where to start (idk if this is possible), so any help will be greatly appreciated.

1

There are 1 best solutions below

0
On

this.binding.inputLayout is the TextInputLayout:

// Get start icon
CheckableImageButton startIcon = this.binding.inputLayout.findViewById(com.google.android.material.R.id.text_input_start_icon);

// Get end icon
CheckableImageButton endIcon = this.binding.inputLayout.findViewById(com.google.android.material.R.id.text_input_end_icon);