0

After setting the custom adapter to AutoCompleteTextView it shows a different color.

enter image description here

<style name="generalExposedDropdownMenu" parent="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
    <item name="boxStrokeColor">@color/text_input_layout_stroke_color</item>
    <item name="hintTextColor">@color/dark_gray</item>
    <item name="fontFamily">@font/nunito_regular</item>
    <item name="android:textSize">12sp</item>
    <item name="endIconTint">@color/dark_gray</item>
    <item name="android:textColorHint">@color/dark_gray</item>
</style>
<com.google.android.material.textfield.TextInputLayout
    android:id="@+id/relationship_textview"
    style="@style/generalExposedDropdownMenu"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/picker_relationship">

    <AutoCompleteTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="none"
        />
val adapter = ArrayAdapter(this, R.layout.list_item, model.relationshipStatuses)

(relationshipTextview.editText as? AutoCompleteTextView)?.setAdapter(adapter)

list_item:

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="16dp"
    android:ellipsize="end"
    android:background="@color/white"
    android:maxLines="1"
    android:textAppearance="?attr/textAppearanceBodyLarge"
    />
Saeid Lotfi
  • 2,043
  • 1
  • 11
  • 23

1 Answers1

0
<dimen name="mtrl_exposed_dropdown_menu_popup_vertical_padding" tools:override="true">0dp</dimen>

AutoCompleteTextView - How to remove margin from top and bottom?

Saeid Lotfi
  • 2,043
  • 1
  • 11
  • 23