androidandroid-fragmentsandroid-softkeyboardadjustpanadjust-android

Android: Keyboard hiding EditText in Fragment [Material]


Premise: I have a fragment located within a frame layout in the activity layout. The application is in full screen mode.

How fragment looks like

Problem: When the keyboard lifts up, it hides some edit text, even the one that currently has the focus.

Problem

Actions already taken: I have already tried setting the flags in the manifest:

android:windowSoftInputMode="adjustPan"  
// OR
android:windowSoftInputMode="adjustResize"
// OR ...

but nothing worked. I also tried setting the flag in the fragment's onCreateView (I also tried in onCreate), but without success.

...
getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
...

Question: What could be the problem? What am I doing wrong?


Solution

  • I have found the solution to the problem: i was using com.google.android.material:material:1.2.0-alpha02 apparently it seems to have problems with the auto-adjustment of the screen. Changing with com.google.android.material:material:1.2.0-alpha06 it worked properly.