I'm developing an Android application (Java) using the standard layout structure: CoordinatorLayout + AppBarLayout + NestedScrollView. I have a long form where some text fields are positioned at the very bottom of the screen.
Here's my simplified layout:
The issue: I'm facing a dilemma regarding the correct windowSoftInputMode setting.
Scenario 1: android:windowSoftInputMode="adjustResize"
Problem: NestedScrollView doesn't automatically scroll to the focused view. The keyboard opens and covers the bottom fields while the scroll position remains at the top. I’ve tried adding clipToPadding="false" and bottom padding, but it doesn't trigger automatic scrolling.
Scenario 2: android:windowSoftInputMode="adjustPan"
I found this solution on Stack Overflow.
Behavior: The screen pans upward so the focused field becomes visible. This solves the scrolling issue—seemingly perfect!
Problem: This breaks the MaterialAutoCompleteTextView dropdown menu. When adjustPan shifts the window upward, the dropdown popup is positioned incorrectly—it often covers the input field itself or appears in the wrong location.
Question: How can I either:
- Make NestedScrollView automatically scroll to the focused view when using adjustResize, OR
- Fix the dropdown menu positioning issue when using adjustPan?
Thank you so much for looking into this! I've already spent several days trying to find a solution and haven't succeeded 😪. Also, I’m not very good with XML.

