Android: Keyboard hiding EditText in Fragment [Material]

777 views Asked by At

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?

2

There are 2 answers

0
sysken On BEST ANSWER

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.

0
AudioBubble On

Try using scrollview for parent to your form.