I need to provide some padding between the keyboard and edittext when soft keyboard pops up which generally hides the bottom part of edittext.
When the soft keyboard is opened, i need the full edittext view to be visible.
And more importantly, I can’t go with android:windowSoftInputMode = "adjustResize"
, which doesn’t work good in my use case. I am using "adjustPan".
So how to achieve the same without changing the windowSoftInputMode?
2
Answers
Create this function for EditText in your class :
and you can use it like this :
That’s it. Happy coding !!! :~)
activity?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
Use this in
OnResume
method of your fragment It works for me