2

I have an Activity with three Fragment and they are controlled by Tabs at the bottom.

One of the fragments needs the keyboard and so I would like to resize the fragment recycler view when the keyboard is visible, so that the last item in the recycler view is visible above the keyboard (after scrolling).

But if in the AndroidManifest.xml, I specify

android:windowSoftInputMode="adjustResize"

or

android:windowSoftInputMode="adjustPan"

The bottom tabs also become visible above the keyboard.

I even tried to use OnGlobalLayoutListener to check when the keyboard is visible and then adjust height of the recycler view accordingly. But this also does not work, since, OnGlobalLayoutListener is called only when android:windowSoftInputMode="adjustPan" or android:windowSoftInputMode="adjustResize" are used, which defeats the purpose in this case.

Is there any way such that the view of the Fragment is resized/adjusted but not the activity view (bottom tabs)?

Thanks

Sunny
  • 7,444
  • 22
  • 63
  • 104

1 Answers1

0

So this is how I solved it.

The keyboard changes are received in OnGlobalLayoutListener when

android:windowSoftInputMode="adjustPan"

And it also does not push the bottom tabs above the keyboard.

Thus, it solves the issue at hand.

Thanks

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Sunny
  • 7,444
  • 22
  • 63
  • 104
  • 1
    Could you explain your solution? just receiving keyboard changes wouldn't make a difference afaik. Are you receiving them and processing them manually or something? – behelit Mar 19 '19 at 00:55