-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating action button moves up when used with keyboard input #2
Comments
to correct that, you could make a new class of FixedCenterDockedFabLocation extends FloatingActionButtonLocation and pass the context to it. it's something like:
|
@vvasc Thanks for this solution, I implemented it and now the FAB does not go up along with the keyboard. However the FAB makes a scale down to 0pixels and back up to its original size animation when the textfield is on focus. You can see it behind the keyboard in iOS simulator with a semi transparent keyboard. Also, in my case, when i change through tabs of my bottomnavbar the same thing happens. Is this something about passing the context? Could you be so kind and check this issue? |
This happens with me too, unfortunately I don't know what causes that. But I've another approach which consist in apply a new fabLocation only when the keyboard appear.
And FixedCenterDockedFabLocation still is the class above. I know this one does not the best solution because the problem with animation FAB, although, this is the only solution I found to use an AppBar with a center FAB. |
how to navigate between other pages, when clicked items in the bottom bar without setting up a default index. |
Code from #2 (comment) needs to be fixed in order to fix animation issue.
|
For future reference, this is an implementation following this idea minus a few quirks, with less lines of code and using more upstream code, i.e. hopefully better to maintain:
Feel free to use this code without limitations or attribution. Also note that when using this, use it with |
This works but the fab gets pushed to the top of the screen and still visible. A work around I used was to "return -100". This way, it gets pushed off the screen. |
First of all, I'm very grateful for this code to exist! But since i've been using it i've been coming across a couple layout bugs.
The first one is, when i'm using the code from the example there seems to be two FABs, and one seems to be lower than the other the first time the app boots up.
![screen1](https://user-images.githubusercontent.com/8982310/48120501-93e1d480-e272-11e8-9de9-58e9a55e5955.png)
again, this is with the exact code from the repo, besides some text and theme changes ofcourse.
The second problem is when you tap on a text field and the keyboard pops up, the FAB moves up as well, and stays there even when you close the keyboard, as seen in the screenshots below. Maybe I'm doing something wrong here, but I'd appreciate some feedback.
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: