Last active
March 25, 2020 07:14
-
-
Save alaershov/e85222cdddef99b14059088247655615 to your computer and use it in GitHub Desktop.
ExposedDropdownMenu input type bug sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val adapter = ArrayAdapter( | |
requireContext(), | |
R.layout.item_dropdown_country, | |
countryList // List<String> | |
) | |
binding.editTextCountry.setAdapter(adapter) | |
binding.editTextCountry.onItemClickListener = AdapterView.OnItemClickListener { parent, view, position, id -> | |
binding.editTextPhone.requestFocus() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.material.textfield.TextInputLayout | |
android:id="@+id/input_layout_country" | |
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:hint="@string/enter_phone_hint_country"> | |
<AutoCompleteTextView | |
android:id="@+id/edit_text_country" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:editable="false" // any combinations of editable and inputType attributes lead to the same result | |
android:inputType="none" | |
tools:ignore="Deprecated,LabelFor" | |
tools:text="Россия" /> | |
</com.google.android.material.textfield.TextInputLayout> | |
<com.google.android.material.textfield.TextInputLayout | |
android:id="@+id/input_layout_phone" | |
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:hint="@string/enter_phone_hint_phone"> | |
<com.google.android.material.textfield.TextInputEditText | |
android:id="@+id/edit_text_phone" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:inputType="phone" /> | |
</com.google.android.material.textfield.TextInputLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment