InputFormAutocompleteTextInputLayout
InputFormAutocompleteTextInputLayout is an extension of InputFormTextInputLayout implementing an exposed dropdown menu.
Style
By default, the Android PoqSDK uses OutlinedBox style. If you want to change the style of all InputFormAutocompleteTextInputLayout, override the XML property BaseInputFormAutocompleteTextInputLayoutMaterialStyle to extend the appropriate material design style. For example, to change the default style to FilledBox, you need to replace this:
<style name="BaseInputFormAutocompleteTextInputLayoutMaterialStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"/>
with this:
<style name="BaseInputFormAutocompleteTextInputLayoutMaterialStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"/>Usage
You can set it up in the layout:
<com.poqstudio.platform.view.account.inputform.ui.PoqInputFormAutocompleteTextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="YourHint" app:autocompleteList="@={viewModel.autocompleteList}" // It allows two-way data binding app:isMandatory="true" // False by default app:validateWhenFocusLost="true" /> // True by default
AutocompleteList class is made from a list of strings defining the available options and an optional selected position.