What I would like is when a user clicks on one of the edit texts for the screen to resize and scroll up so the it focuses on the that edit text.
The manifest is setup for adjust resize:
<activity
android:name=".ui.login.LoginActivity"
android:label="@string/app_name"
android:theme="@style/AppThemes"
android:windowSoftInputMode="stateHidden|adjustResize"/>
The XML layout for the login screen:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:src="@drawable/main_background" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--<LinearLayout-->
<!--android:id="@+id/login_header"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:paddingTop="30dp"-->
<!--android:paddingBottom="30dp"-->
<!--android:gravity="center_horizontal"-->
<!--android:orientation="vertical">-->
<!--<ImageView-->
<!--android:id="@+id/login_fragment_logo"-->
<!--android:layout_width="120dp"-->
<!--android:layout_height="120dp"-->
<!--android:src="@drawable/logo_with_dropshadow" />-->
<!--<TextView-->
<!--android:id="@+id/login_fragment_app_title"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_margin="5dp"-->
<!--android:text="@string/digital_door_viewer"-->
<!--android:textAllCaps="true"-->
<!--android:textSize="18sp" />-->
<!--</LinearLayout>-->
<LinearLayout
android:orientation="vertical"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/login_fragment_email_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="@color/white"
android:hint="@string/email"
android:inputType="textEmailAddress"
android:padding="8dp"
android:singleLine="true"
android:textSize="20sp"/>
<EditText
android:id="@+id/login_fragment_password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:hint="@string/password"
android:inputType="textPassword"
android:padding="8dp"
android:singleLine="true"
android:textSize="20sp" />
<Button
android:id="@+id/login_fragment_register_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:layout_marginTop="10dp"
android:background="@android:color/transparent"
android:minHeight="0dp"
android:text="@string/register"
android:textAllCaps="false"
android:textSize="16sp" />
<Button
android:id="@+id/login_fragment_forgot_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="15dp"
android:layout_marginTop="5dp"
android:background="@android:color/transparent"
android:minHeight="0dp"
android:text="@string/forgot_your_password"
android:textAllCaps="false"
android:textSize="16sp" />
<Button
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/yellow_selector"
android:minHeight="0dp"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:text="@string/login"
android:textAllCaps="true"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
What's going wrong is when I uncommented the header for the screen, it doesn't scroll up but with it commented out it works as intended...what am I missing?