I've this layout:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_birthdate"
style="@style/ExposedDropDownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/birthdate">
<AutoCompleteTextView
android:id="@+id/autocomplete_birthdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:editable="false" />
</com.google.android.material.textfield.TextInputLayout>
With this style:
<!-- ExposedDropdownMenu -->
<style name="ExposedDropDownMenu" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
<item name="boxStrokeColor">@color/text_input_layout_outlined_box_stroke</item>
<item name="hintTextColor">@color/green_2</item>
</style>
I've tried to set a click listener on the autocomplete text view:
autoComplete.setOnClickListener(view -> {
// This is called twice when i click the autocomplete textview
});
The listener is called twice...why? How can i solve this?
EDIT: removing the style, the first click (gaining the focus) is ignored, than the second click is called correctly once, but I lose the "ripple" background effect anyway.