The exact same APK behaves differently on Android versions before API 26 and after it. I have simplified my layout down to the following example:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="200dp" android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/top_button" android:textSize="14sp"
android:layout_width="100dp" android:layout_height="50dp"
android:text="Top" android:padding="0dp" />
<EditText
android:id="@+id/filename" android:textSize="14sp"
android:layout_width="fill_parent" android:layout_height="50dp"
android:inputType="textNoSuggestions" android:singleLine="true" />
<Button
android:id="@+id/bottom_button" android:textSize="14sp"
android:layout_width="100dp" android:layout_height="50dp"
android:text="Bottom" android:padding="0dp" />
</LinearLayout>
I know there were changes to keyboard navigation in API 26 (Oreo), described in the Input and Navigation section here but I don't see why this particular functionality is affected:
Using the Tab key (focus next) for keyboard navigation, focus starts on the "Top" button, moves to the EditText, then moves to the "Bottom" button. This is as expected.
Using the down-arrow key (focus down), focus starts on the "Top" button, moves to the EditText, and then stays there. On Android versions before API 26 however, it moves to the "Bottom" button, which is what I want.
How can I change this so that down-arrow key navigation still works to move focus away from the EditText on API 26 and later?
Update
After further testing on different emulator builds, it seems that this "getting stuck" behaviour happens on APIs 26, 27 and 28, but it doesn't happen on APIs 29, 30 and 31.
This suggests that the behaviour is a bug that was introduced in Android 8.0 (API 26) and then fixed in Android 10.0 (API 29).
I'm still interested in any workaround that may be possible to fix the behaviour for APIs 26 to 28.