0

I have a fragment with 3 EditTexts which should be focusable on touch.

I need to make all EditTexts visible when clicking on a EditText. That means when I click on EditText 1, EditText 3 should be visible. So basically Every EditText should be visible at all times.

Right now, when I click on a EditText fragment shifts a bit, but still blocks EditText number 3.

This is my code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="6"
android:orientation="horizontal">

<View
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1" />

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="4"
    android:orientation="vertical">

    <EditText
        android:id="@+id/et_username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/apptheme_textfield_white_holo_no_borders_light"
        android:gravity="center"
        android:hint="@string/username_tag"
        android:imeOptions="flagNoExtractUi|actionNext"
        android:inputType="text"
        android:maxLines="1"
        android:textColor="@android:color/white"
        android:textColorHint="@color/gray_lighter"
        android:textCursorDrawable="@null" />

    <EditText
        android:id="@+id/et_email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:background="@drawable/apptheme_textfield_white_holo_no_borders_light"
        android:drawablePadding="5dp"
        android:drawableStart="@drawable/profile_pressed"
        android:gravity="center"
        android:hint="@string/email_tag"
        android:imeOptions="flagNoExtractUi|actionNext"
        android:inputType="textEmailAddress"
        android:maxLines="1"
        android:textColor="@android:color/white"
        android:textColorHint="@color/gray_lighter"
        android:textCursorDrawable="@null" />

    <EditText
        android:id="@+id/et_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/apptheme_textfield_white_holo_no_borders_light"
        android:drawablePadding="5dp"
        android:drawableStart="@drawable/padlock"
        android:gravity="center"
        android:hint="@string/password"
        android:imeOptions="flagNoExtractUi|actionDone"
        android:inputType="textPassword"
        android:maxLines="1"
        android:textColor="@android:color/white"
        android:textColorHint="@color/gray_lighter"
        android:textCursorDrawable="@null" />

</LinearLayout>

<View
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1" />

</LinearLayout>

I tried messing with adjustPan and adjustResize in manifest but both don't work.

this is image:

enter image description here

note that EditText 3 with password input is blocked by keyboard.

hyrulelink16
  • 389
  • 1
  • 5
  • 17

1 Answers1

0

add following property in your manifest in tag where you declare your activity :-

windowSoftInputMode="adjustResize"

and put your layout in scroll view

Varun Jain
  • 171
  • 2
  • 14