I've seen various posts about FABs responding to Snackbar popups at the bottom of the screen as well as scroll-sensitive FABs. But is there some implementation of FloatingActionButton.Behavior
(or similar) to move the FAB above the keyboard when it pops up?
Right now, the keyboard covers the FAB when I click for example in an EditText
box. My goal is to animate the FAB so it is always visible, independent of the keyboard status.
EDIT: Both android:windowSoftInputMode="adjustResize"
and ...="adjustPan"
won't change anything. Well, adjustResize
resizes the underlying layout (which is in my case a map) but the FAB doesn't move.
Hi there i know it's old but for future or current readers/searchers and also the thread maker, he hasn't found answer yet. This is how i am having this behaviour in my app.
Fab hides on RecyclerView scroll, goes up when snack bar pops out, if fab is not shown and snackbar popus up and if you scroll then still Fab will be shown top of snack bar and will move down when SB disappears and last with keypad if it opens Fab will be pushed up. (sorry, i had to write coz i don't know how to give gif with eclipse emulator)
Image
Layout
As you can see i am using FabAnimation class to override some of its default methods.
ScrollingFABAnimation
I had the same problem, i tried to add a
ScrollView
inside my root view but it did not works because the content doesn't exceed the display's height (the fab react as expected in that case).So i tried
android:windowSoftInputMode="adjustResize"
and it works for me.For informations here's what my layout xml looks like:
it's a
Fragment
inflated in an activity (in aFrameLayout
thatmatch_parent
the root view) for which i addedandroid:windowSoftInputMode="adjustResize"
in the manifest.