Floating button needs to be hided above keyboard

Floating button needs to be hided above keyboard

how to move floating action button in android
android hide navigation bar programmatically
android hide navigation bar when keyboard show

I have a custom floating button.It works fine.I have some editText field too.My problem is whenever I am entering text the floating button appears above the keyboard.How to hide it? i.e.: Floating button should not visible when I am entering text.

My Layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.te.thm.se.Insert"
    android:background="@drawable/primary_gradient">
    <com.wang.avi.AVLoadingIndicatorView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:indicatorName="BallScaleMultipleIndicator"
        android:layout_gravity="center"
        app:indicatorColor="@android:color/white"
        android:id="@+id/loading_indicator"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:layout_marginBottom="20dp"
        />
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scrollView">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        app:cardCornerRadius="4dp"
        app:cardElevation="1dp"
        app:cardMaxElevation="0dp"
        app:cardUseCompatPadding="true"
        android:animateLayoutChanges="true"
        android:id="@+id/header_card"
        android:layout_marginTop="5dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingTop="5dp"
            android:paddingBottom="5dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="5dp">
                <TextView
                    android:id="@+id/requisition_no"
                    android:layout_width="140dp"
                    android:layout_height="wrap_content"
                    android:padding="1dp"
                    android:text="@string/requisition_no_label"
                    android:textColor="@color/primary_text"
                    android:textSize="14sp" />
                <TextView
                    android:id="@+id/requisition_no_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="1dp"
                    android:text="@string/autogenerated"
                    android:textColor="@color/secondary_text"
                    android:textSize="14sp" />
                </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="5dp">
                <TextView
                    android:id="@+id/title"
                    android:layout_width="140dp"
                    android:layout_height="wrap_content"
                    android:padding="1dp"
                    android:text="@string/title_label"
                    android:textColor="@color/primary_text"
                    android:textSize="14sp" />

                <EditText
                    android:id="@+id/title_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:ems="10"
                    android:inputType="textPersonName"
                    android:textColor="@color/primary_text"
                    android:textSize="14sp"/>


            </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp">
        <TextView
            android:layout_width="140dp"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:text="@string/date_label"
            android:id="@+id/date"
            android:padding="1dp"
            android:textColor="@color/primary_text"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:text="00-00-0000"
            android:id="@+id/date_value"
            android:padding="1dp"
            android:textColor="@color/colorAccent"
            android:onClick="getDates"/>
        </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp">
        <TextView
            android:layout_width="140dp"
            android:layout_height="wrap_content"
            android:textSize="14sp"
            android:text="@string/company_name_label"
            android:id="@+id/company_name"
            android:padding="1dp"
            android:textColor="@color/primary_text"/>


        <com.toptoche.searchablespinnerlibrary.SearchableSpinner
            android:id="@+id/company_name_value"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <!--<Spinner-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:id="@+id/company_name_value"/>-->
        </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="5dp">
                <TextView
                    android:layout_width="140dp"
                    android:layout_height="wrap_content"
                    android:textSize="14sp"
                    android:text="@string/employee_name_label"
                    android:id="@+id/Employee_name"
                    android:padding="1dp"
                    android:textColor="@color/primary_text"/>

                <com.toptoche.searchablespinnerlibrary.SearchableSpinner
                    android:id="@+id/employee_name_value"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
                <!--<Spinner-->
                <!--android:layout_width="match_parent"-->
                <!--android:layout_height="wrap_content"-->
                <!--android:id="@+id/employee_name_value"/>-->
            </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp">
        <TextView
            android:layout_width="140dp"
            android:layout_height="wrap_content"
            android:text="@string/requisition_status_label"
            android:textColor="@color/primary_text"
            android:textSize="14sp"
            android:padding="1dp"
            android:id="@+id/status"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/open"
            android:textColor="@color/secondary_text"
            android:textSize="14sp"
            android:padding="1dp"
            android:id="@+id/status_value"/>
        </LinearLayout>
            <com.unstoppable.submitbuttonview.SubmitButton
                android:layout_marginRight="10dp"
                android:layout_marginLeft="10dp"
                android:layout_gravity="end"
                android:id="@+id/approve_button"
                android:layout_width="90dp"
                android:layout_height="30dp"
                android:padding="5dp"
                android:layout_marginTop="8dp"
                android:onClick="submitRequisition"
                app:buttonColor="@color/colorAccent"
                app:buttonText="Submit"
                app:buttonTextSize="15sp"/>
</LinearLayout>
    </android.support.v7.widget.CardView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/requisition_detail_list"
            android:orientation="vertical"
            android:animateLayoutChanges="true">
        </LinearLayout>
        </LinearLayout>
    </ScrollView>


    <com.robertlevonyan.views.customfloatingactionbutton.FloatingActionButton
        android:id="@+id/custom_fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:fabType="roundedSquare"
        app:fabText="SAVE"
    android:layout_gravity="bottom|center"
    android:layout_margin="16dp"
    android:layout_alignParentBottom="true"
    android:layout_centerInParent="true">

    </com.robertlevonyan.views.customfloatingactionbutton.FloatingActionButton>


</RelativeLayout>

EDIT

I added android:windowSoftInputMode="adjustNothing"

But It will also hide editText field


I have gone one library with which you can find the visibility of Keyboard. and i have handle the visibility of floating action button when keyboard is visible or not.

add dependency in app.gradle file

implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'

Add following code in Activity onCreateMethod()

KeyboardVisibilityEvent.setEventListener(
                this,
                new KeyboardVisibilityEventListener() {
                    @Override
                    public void onVisibilityChanged(boolean isOpen) {
                       if(isOpen)
                       {
                           custom_fab.setVisibility(View.GONE);
                       }
                       else
                       {
                           custom_fab.setVisibility(View.VISIBLE);
                       }
                    }
                });

Floating Action Button - Moves when Keyboard Opened, I have gone one library with which you can find the visibility of Keyboard. and i have handle the visibility of floating action button when keyboard  Android: How to push button above soft keyboard. I've got a "save" button which I want to push up together with the soft keyboard. So when the user clicks an EditText in my layout, then the button has to stay above the keyboard. Now the button becomes hidden underneath the keyboard.


Make it false. Something like this

android:layout_alignParentBottom="false"

fabicon not hidden behind when keyboard is diplayed · Issue #22 , When someone opens the keyboard to type a search, the floating action button moves above the keyboard. It is treating the top of the keyboard as where it should take the When Keyboard visible, hide floating button and How to hide Floating Action Button when scrolling in Recycler View Published by Gurleen Sethi on March 14, 2017 March 14, 2017 You might have seen many applications hiding the FAB on scrolling down and showing back when scrolling up.


Remove gravity from FloatingActionButton

<com.robertlevonyan.views.customfloatingactionbutton.FloatingActionButton
        android:id="@+id/custom_fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:fabType="roundedSquare"
        app:fabText="SAVE"
        android:layout_margin="16dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true">

    </com.robertlevonyan.views.customfloatingactionbutton.FloatingActionButton>

Hide the navigation bar, the fab icon is above the keyboard as it should be hidden behind the icon & show after I click the back button to collapse the search viw  getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); which hides any soft input area when normally appropriate, help to answer the OP's question of: "Still I cannot get the linear layout image buttons above the soft keyboard."


In your Activity of Android.manifest file

android:fitsSystemWindows="false" to android:fitsSystemWindows="true"

and put android:windowSoftInputMode="adjustNothing"

Handle keyboard input, The user interaction causes the flags to be be cleared. Once the flags have been cleared, your app needs to reset them if you want to hide the  You can scroll up without hiding the keyboard. If you set android:windowSoftInputMode="adjustResize", the top portion of the activity (Toolbar/Appbar) is maintained with EditText pushed to above the keyboard. When you focus on EditText No 7, it is still possible to scroll up and down (focus on EditText No 8) without the need to hide the keyboard.


Button, Overview · Dim the system bars · Hide the status bar · Hide the The Android system shows an on-screen keyboard—known as a soft input or email address​) and how the input method should behave (such as whether it such as spelling suggestion behavior and action buttons such as Done or Next. Namely, the floating action button breaks the edge between the content and an app bar with flexible space. When scrolling: The flexible space shrinks until only the toolbar remains. When scrolling to the top of the page, the flexible space grows into place again. The floating action button animates onto the screen as an expanding piece of material.


iPadOS - Features, Keyboard accessible buttons will preserve focus styles after click, which may be visually Make sure there is enough room for the hidden content to show Or buttons can have their text localized, or adjusted by using the data-text attribute. I have this Floating Action Button (GitHub link) and when I open a (software) keyboard the Floating Action Button hides behind the keyboard. Is there a way that I can push it above the keyboard? Edit: tab_random.xml


Use the Accessibility Keyboard on Mac, Swipe left and right with three fingers to switch between apps. Move the cursor to the right edge to hide Slide Over. Control Center. Click the status bar in the upper​  Tap or click the touch keyboard settings button. Tap or click the floating keyboard button. To change back to a fixed keyboard, repeat the steps but tap the fixed keyboard button, located next to the floating keyboard button in the second row of the menu.