I want my soft keyboard to push content upward when it encounters it.
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_INPUT_ADJUST_RESIZE)
This doesn't do anything, and if I use ADJUST_PAN, the ENTIRE screen moves with all the content. I just want the screen to be pushed up when content is encountered, and for the header not to move at all.
Here is my layout. It's a chat app, so i'm adding layouts programmatically.
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/open_messsages_constraint"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".OpenMessages">
<ScrollView
android:id="@+id/messages_scroll2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/allMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintTop_toTopOf="parent"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#ffffff"
android:backgroundTint="#ffffff"
app:layout_constraintBottom_toBottomOf="parent">
<EditText
android:id="@+id/messageInput"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:layout_weight="4"
android:background="@drawable/rounded_corner"
android:backgroundTint="#f1f1f1"
android:paddingLeft="20dp"
android:textColorLink="#000000" />
<com.google.android.material.button.MaterialButton
android:id="@+id/sendMessageButton"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:backgroundTint="#ffffff"
android:gravity="center"
android:stateListAnimator="@null"
app:iconTint="#000000">
</com.google.android.material.button.MaterialButton>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
How do I go about this?