OK, so I have this very basic layout:
As you can see, the edit texts and the login button are centered in the area below the icon. They are not aligned with the bottom. And I want to keep it this way.
Now, when the soft keyboard is shown, all I want is that the whole view is pushed upwards, so that the login button is above the soft keyboard but takes into account its lower margin.
My activity has windowSoftInputMode
set to adjustPan
, but it just assures that the currently focused control is visible, not all three of them:
Question: What do I need to change so that all three controls are visible as soon as the keyboard is visible?
This is my view:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/Recson.Apps.Android"
style="@style/Theme.Recson.NoActionBar"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/LoginViewRoot">
<ImageView
android:src="@drawable/Logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/Icon"
android:layout_marginBottom="30dp"
android:layout_marginTop="30dp"
android:layout_gravity="top" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/Credentials"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_below="@id/Icon">
<EditText
android:inputType="textEmailAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
local:MvxBind="Text Username"
android:hint="@string/Username"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:textColorHint="@color/text_hint" />
<EditText
android:inputType="textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
local:MvxBind="Text Password"
android:hint="@string/Password"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:textColorHint="@color/text_hint" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Login"
local:MvxBind="Click Login;Enabled CanLogin"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp" />
</LinearLayout>
</RelativeLayout>