Every time the keyboard opens it pushes my root constraint layout up off the screen.
This is it normally
Then when i click a span it brings up a little control panel thing at the bottom like so, note the top of the screen with the title.
now when i click the edit text to type my answer it pushes everything up and the highest i can scroll is here, its like the top of the scrollview is up off the top of the screen. i can no longer see the title or question 1. This is with adjustPan
set in the manifest. Ive tried to change it to adjust resize as i thought that would resize the views height but it makes it worse.
here is my 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:id="@+id/questionRoot"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?android:attr/colorBackground"
android:clickable="true"
android:focusable="true">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="@+id/actionFrameLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/questionTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="48dp"
android:layout_marginEnd="16dp"
android:textAlignment="viewStart"
android:textColor="#353535"
android:textSize="18sp"
android:textStyle="bold"
tools:text="Title" />
<TextView
android:id="@+id/questionBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/questionTitle"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:lineSpacingExtra="10dp"
android:paddingBottom="32dp"
android:textSize="16sp" />
</RelativeLayout>
</ScrollView>
<View
android:id="@+id/topBorder"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#D3D3D3"
app:layout_constraintBottom_toTopOf="@id/frameLayout"
/>
<View
android:id="@+id/bottomBorder"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#D3D3D3"
app:layout_constraintBottom_toBottomOf="parent"
/>
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/white"
app:layout_constraintBottom_toTopOf="@id/bottomBorder"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/showTimer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Timer" />
<Button
android:id="@+id/finishTestButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Finish" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/actionFrameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/frameLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent">
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
edit: this is what setting the manifest file with adjustResize
does :