How do you hide floating action buttons from the keyboard? - android

I have FloatingActionButtons and FloatingActionMenus in CoordinatorLayouts, but I also have some EditTexts in there too, with the adjustPan window mode. But when I go to click the EditTexts, the floating buttons/menus come up along with the keyboard and somewhat block the visible area (such as the row containing the EditText). Can I somehow prevent the floating items from coming up with the keyboard?

There is a library which can listen to keyboard visibility, if the keyboard is visbile make the FAB to GONE or INVISIBLE.
https://github.com/yshrsmz/KeyboardVisibilityEvent

Related

Android | How to hide BottomNavigation even if windowSoftInputMode is set to 'adjustResize'?

I have an activity with BottomNavigation. If the user needs to click on the submit button soft keyboard hides it. Then he again needs to press the back button to see the submit button. In this case, I used windowSoftInputMode='adjustResize' so that the screen gets resized automatically and the user can scroll up and click on the submit button.
But, I have BottomNavigation too, windowSoftInputMode='adjustResize' makes BottomNavigation float above the soft keyboard. Can anyone suggest a better solution? Any help will be appreciated. Thanks
Thats tricky issue... You have two options in here:
Keep 'adjustResize' and hide BottomNavigation view when keyboard pops up (e.g. simply setVisiblity?)
Change to e.g. 'adjustPan' (or any other) preventing keyboard resizing app and add bottom padding with height of keyboard for whole content container. BottomNavigation will stay hidden under keyboard, but padding will allow scrolling to Submit button
In both cases you need to detect open/close keyboard, in second case you will also need keyboard height measuring. IN HERE and HERE you have big SO topics about this case, check out answers and comments, and pick proper resolution for your purposes

Is it possible to use adjustPan and keep the selection action mode on screen?

I have an EditText element at the bottom of the screen (like Whatsapp i.e), and I'm using android:windowSoftInputMode="adjustPan" in order not to hide the EditText when the keyboard appears. It works fine, it pushes the whole layout up so that the EditText can be seen.
Now, the problem is that when I select the text, the action mode bar doesn't appear, as if it was pushed up along with the layout.
I'm not using an explicit action bar in my layout, it's the one that appears on pre M devices when a text selection is made.
The layout hierarchy goes like this:
<FrameLayout>
<GLSurfaceView/>
<EditText/>
</FrameLayout>
So all I want to do is this action mode to keep it's position even when the keyboard is opened, using the pan behaviour.
adjustResize doesn't work for me. When set, the keyboard is over the EditText, and nothing resizes, probably due to GLSurfaceView.
Thanks!

Keyboard layout hiding android action bar?

In my Android application running in a XOOM device, when I click in an Edittext the keyboard opens and hides the Actionbar. I don't want this to happen, how can I solve this? This is done by the Google Contacts app for the tablet for example.
EDIT:
I have several edittexts in which the user needs fo fill. At first, when the user clicked on one edittext on the bottom, the keyboard showed up and hide the edittext in which the user was typing, so he couldn't see what he was typing. I found it really bad, and to solve it I just added to the manifest: android:windowSoftInputMode="stateVisible|adjustPan"
But after that, now the screen adjust itselfs and hides the action bar.
The Google Contacts app does the same, but it magically doesn't hide the Action bar. How do they do it?
Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.
If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

Disable soft keyboard when using ViewFlipper

I am using ViewFlipper to swipe through different layouts each having their own EditText boxes. When I swipe to next/previous child, the soft keyboard automatically pops up even if I disabled using android:windowSoftInputMode="stateAlwaysHidden" for the activity in the manifest file.
I want to disable the automatic popping up of the soft keyboard and make it appear only if the user clicks on EditText box. Can somebody help?
Solved it by including
android:focusableInTouchMode="true" in the parent LinearLayout of each child.

How to avoid the on-screen keyboard from covering the EditText in android

whenever I click on the EditText, the screen readjusts and the edittext-view moves up. But this is not enough and the soft-keyboard still covers the view to not show what a user typing.
My layout is as follows:
A listview occupying 65% of screen height, followed by an editetxt view and a button
LISTVIEW
______________________________
EDITTEXT |BUTTON
______________________________
My activity has the following flag set android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
adjustPan forces the soft keyboard to appear on top of your layout, blocking anything at the bottom. You're going to want to use adjust resize instead, which will move up your EditText and Button, and shrink the ListView. If, in landscape mode, the ListView is shrunk to the point of being unusable/pointless, consider using a fullscreen IME keyboard.
Read about something like that just recently. Is this what you are looking for?
http://www.vogella.de/blog/2010/10/25/android-windowsoftinputmode/

Categories

Resources