Ozan Manav Ozan Manav - 3 months ago 13
Android Question

When click edittext layout go up

I tried android:windowSoftInputMode="adjustResize" but its not working. After the enter password user must click end but I need to be able to see my login button - but how ? :)

My problem is this :
enter image description here

I added to manifest android:windowSoftInputMode="adjustResize" but nothing changes.

My xml code :

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="56dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:id="@+id/touchInterceptor">

<ImageView
android:layout_width="133dp"
android:layout_height="137dp"
android:id="@+id/imageView"
android:layout_gravity="center_horizontal"
android:background="@drawable/elma_logo4"
android:layout_weight="2.00" />
<!-- Email Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">
<EditText android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="Email"
android:focusable="false"/>
</android.support.design.widget.TextInputLayout>

<!-- Password Label -->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">
<EditText android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:hint="@string/ifre"
android:focusable="false"/>
</android.support.design.widget.TextInputLayout>


<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Şifremi Hatırla"
android:id="@+id/cb_Hatirla"
android:layout_weight="2.00"/>

<android.support.v7.widget.AppCompatButton
android:id="@+id/btn_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:padding="0dp"
android:text="Giriş"/>

<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar"
android:layout_gravity="center_horizontal" />


<TextView android:id="@+id/link_forgotpass"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="Şifremi Unuttum?"
android:gravity="center"
android:textSize="16dip"/>

<TextView android:id="@+id/link_signup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="Hesabınız yok mu ? Hemen Oluşturun!"
android:gravity="center"
android:textSize="16dip"/>



</LinearLayout>
</ScrollView>

Answer

Put android:imeOptions="actionNext" to input_email EditText. Which helps you to show next button on keyboard to navigate input_password.

And put android:imeOptions="actionDone" to input_password EditText, which helps you to show Done button on keyboard. When click on Done button you can able to see you btn_login.

It is proper way to navigate user in EditText.

See Specifying the Input Method Type for EditText.

I hope its helps you.