I added aListPopupWindow
anchored to a TextInputLayout
. The issue I have with this is that the animation for the popup starts within the TextInputLayout
:
Note that the issue is just where the animation starts. After the animation has finished, the popup is correctly shown below the TextInputLayout
.
What do I have to do to let the animation start just below the TextInputLayout
? Note that it's not my own animation, but the default one.
Layout snippet:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="hint" />
</com.google.android.material.textfield.TextInputLayout>
Code for the ListPopupWindow
:
val arrAdapter = ArrayAdapter<String>(
this,
R.layout.dropdown_menu_popup_item,
listOf("hello", "world")
)
val listPopupWindow = ListPopupWindow(this).apply {
anchorView = findViewById(R.id.textInputLayout)
setAdapter(arrAdapter)
}
findViewById<Button>(R.id.button).setOnClickListener {
listPopupWindow.show()
}
Code also available on Github: https://github.com/wondering639/stack-listpopupwindow-animation-start
Hint: This is just a reduced test case. I am aware of AutoCompleteTextView
, but I really need to manually show a ListPopupWindow
.