Клавиатура перекрывает текст

У меня в androidmanifest установлено android:windowSoftInputMode="adjustPan", все вроде должно быть хорошо когда вызываю клавиатуру EditText изменяет размер и клавиатура не перекрывает текст, но вместе с этим пропадает toolBar (Когда editText изменяет размер, тулбар идет за рамки видимости). Как это исправить?

Код notesActivity.xml

`<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=".Notes.NotesActivity">

    <include
        android:id="@+id/toolbar_actionbar"
        layout="@layout/toolbar" />


    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/toolbar_actionbar"
        android:windowSoftInputMode="adjustPan"
        >


        <EditText
            android:id="@+id/newNotesTextInput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#00FFFFFF"
            android:ems="12"
            android:gravity="start|top"
            android:inputType="textMultiLine"
            android:padding="10dp"
            android:textColor="@drawable/edittext_selector"
            android:textSize="16dp">

            <requestFocus />
        </EditText>

    </ScrollView>

    <ImageButton
        android:id="@+id/editNotesButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:background="@drawable/rounded_button"
        android:foreground="?android:attr/selectableItemBackgroundBorderless"
        android:visibility="invisible"
        android:onClick="activeButtonEditText"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:srcCompat="@drawable/ic_edit" />


</androidx.constraintlayout.widget.ConstraintLayout>

`


Ответы (1 шт):

Автор решения: Andrii Pasichnik

Исправил методом изменения android:windowSoftInputMode="adjustPan" на android:windowSoftInputMode="adjustResize". И закрепил тулбар.

→ Ссылка