I want to have a button that should be sticky at the bottom when Keyboard is open.
Linear layout with a long-form that contains multiple edittext in the vertical orientation.
Button is at the bottom and outside of scrollview
Manifest has a adjustsize
property
So when I click any of the edit text, the Button comes up on the top of the Keyboard.
I have even tried android:fitsToSystemWindow=true
but nothing works
I want something like that where the button does not come up on the keyboard and button should be sticky at the bottom too. How can I achieve that ?
Here is my XML file
<androidx.constraintlayout.widget.ConstraintLayout
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=".items.ui.AddEditItemFragment">
<ScrollView android:id="@+id/sv_add_edit_item" android:layout_width="match_parent"
android:layout_height="0dp" app:layout_constraintBottom_toTopOf="@+id/btn_save"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/itemNameInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:background="@color/white"
android:padding="@dimen/default_margin_padding" app:errorEnabled="true"
app:errorTextAppearance="@style/ErrorText" app:hintTextAppearance="@style/HintText">
<com.google.android.material.textfield.TextInputEditText
style="@style/editTextInputLayout" android:layout_width="match_parent"
android:layout_height="wrap_content" android:inputType="textCapWords"
android:maxLines="1" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</ScrollView>
<Button android:id="@+id/btn_save" style="@style/buttonThemeColor"
android:layout_width="match_parent" android:text="@string/save"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>```
Any help will be appreciated