0

I have a tabbed AppBarLayout with Fragments. On my soft key phone (Sony Xperia Z1 Compact) my App shows below the status bar (as it should be), but behind the soft keys.

Is there a way to set the bounds of the activity (CoordinatorLayout) to end above the soft keys?

I found some solutions for API 19, but my minVersion is 11.

Edit

Maybe it's not a concern of the activity but the ViewPager, that ignores the size of the AppBar and adds it.

g4rf
  • 11
  • 7

1 Answers1

0

Add in the Manifest, for every Activity that needs to adapt to the keyboard change, this:

<activity ... android:configChanges="orientation|keyboardHidden|screenSize" 
android:windowSoftInputMode="adjustResize">

The key here is adjustResize, opposed to the more common adjustPan –the former tells the end of the screen is on top of the keyboard, the latter tells that the input should be always visible above the keyboard.

Regarding the configChanges, there's also the screenSize event, that triggers an app cycle when the keyboard is shown/hidden.

Sergi Juanola
  • 6,531
  • 8
  • 56
  • 93
  • Thanks. I tried something like this befor with no effect. Maybe it's not a concern of the activity but the ViewPager, that ignores the size of the AppBar and adds it. – g4rf Jun 13 '16 at 14:49