Set FAB (Floating Action Button) above keyboard

David picture David · Dec 10, 2015 · Viewed 15.4k times · Source

Already asked here but without a proper answer.

I want the FAB to float on top of the keyboard. that's it.

For example

  1. Open a new Blank Activity template project with Android Studio
  2. Change the Hello World TextView to EditText
  3. See image below:

enter image description here

Answer

David picture David · Dec 10, 2015

Turns out it's pretty easy,

  • Add android:windowSoftInputMode="adjustResize" to your activity in manifest
  • Make sure your root view in layout xml, has android:fitsSystemWindows="true" property