I added the windowSoftInputMode in my AndroidManifest but it doesn't work. I tried put adjustPan, adjustResize, but nothing work.
AndroidManifest.xml:
<activity
android:name="com.evehx.evehx.view.CreateAgendamentosActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"/>
activity_create_agendamentos.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="@color/bg_main"
android:fitsSystemWindows="true"
tools:context=".view.CreateAgendamentosActivity">
<TextView
android:id="@+id/textView2"
android:layout_width="320dp"
android:layout_height="45dp"
android:layout_centerHorizontal="true"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical|center_horizontal"
android:text="@string/lbl_titleAgendamento"
android:textColor="@color/white"
android:textSize="30sp" />
<RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="338dp"
android:layout_height="45dp"
android:orientation="horizontal"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true">
<RadioButton
android:id="@+id/radioProtensao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.79"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Protensao"
android:textColor="@color/white"
android:textSize="20sp" />
<RadioButton
android:id="@+id/radioLocacao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Locacao"
android:textColor="@color/white"
android:textSize="20sp" />
</RadioGroup>
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="338dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/radioGroup2"
android:layout_alignLeft="@+id/radioGroup2"
android:layout_alignStart="@+id/radioGroup2">
<RadioButton
android:id="@+id/radioEntrega"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Entrega"
android:textColor="@color/white"
android:textSize="20sp" />
<RadioButton
android:id="@+id/radioRetirada"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Retirada"
android:textColor="@color/white"
android:textSize="20sp" />
</RadioGroup>
<Spinner
android:id="@+id/cmbObras"
android:layout_width="match_parent"
android:layout_height="45dp"
android:backgroundTint="@color/white"
android:layout_below="@+id/radioGroup"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="12dp" />
<Spinner
android:id="@+id/cmbPavimento"
android:layout_width="match_parent"
android:layout_height="45dp"
android:backgroundTint="@color/white"
android:layout_below="@+id/cmbObras"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="12dp" />
<EditText
android:id="@+id/txtDataAgendamento"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/cmbPavimento"
android:layout_marginTop="11dp"
android:background="@color/white"
android:enabled="false"
android:gravity="center_vertical|center_horizontal"
android:hint="@string/dataEntregaRetirada"
android:inputType="textCapWords"
android:maxLines="1"
android:padding="10dp"
android:textColor="@color/input_register"
android:layout_toLeftOf="@+id/button1"
android:layout_toStartOf="@+id/button1" />
<ImageButton
android:id="@+id/button1"
android:layout_width="52dp"
android:layout_height="45dp"
android:layout_marginLeft="8dp"
android:background="@drawable/calendar"
android:onClick="setDate"
android:scaleType="fitXY"
android:layout_alignTop="@+id/txtDataAgendamento"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:id="@+id/txtVersaoProjeto"
android:layout_width="357dp"
android:layout_height="45dp"
android:background="@color/white"
android:backgroundTint="@color/white"
android:ems="10"
android:gravity="top"
android:hint="@string/ultimaVersaoProjeto"
android:inputType="textMultiLine"
android:lines="1"
android:paddingLeft="10dp"
android:scrollbars="vertical"
android:layout_marginTop="14dp"
android:layout_below="@+id/txtDataAgendamento"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:id="@+id/txtDetalhesAgendamento"
android:layout_width="352dp"
android:layout_height="match_parent"
android:layout_above="@id/btnNovoAgendamentos"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/txtVersaoProjeto"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:background="@color/white"
android:backgroundTint="@color/white"
android:ems="10"
android:gravity="top"
android:hint="@string/detalhes"
android:inputType="textMultiLine"
android:lines="12"
android:paddingLeft="10dp"
android:paddingBottom="16dp"
android:scrollbars="vertical" />
<Button
android:id="@+id/btnNovoAgendamentos"
android:layout_width="352dp"
android:layout_height="48dp"
android:layout_marginBottom="16dp"
android:background="@color/btn_default_bg"
android:text="@string/btn_send"
android:textColor="@color/btn_default"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
When i touch on the last edit text, only the button float whit the keyboard.
How can i do for the edittext's move up together with the button?
I solved the problem putting a scroll view:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="@color/bg_main">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<LinearLayout
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentTop="true">
<TextView
android:id="@+id/textView2"
android:layout_width="320dp"
android:layout_height="45dp"
android:layout_centerHorizontal="true"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical|center_horizontal"
android:text="@string/lbl_titleAgendamento"
android:textColor="@color/white"
android:textSize="30sp" />
<RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="338dp"
android:layout_height="45dp"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radioProtensao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.79"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Protensao"
android:textColor="@color/white"
android:textSize="20sp" />
<RadioButton
android:id="@+id/radioLocacao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Locacao"
android:textColor="@color/white"
android:textSize="20sp" />
</RadioGroup>
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="338dp"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/radioGroup2"
android:layout_alignStart="@+id/radioGroup2"
android:layout_below="@+id/radioGroup2"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radioEntrega"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Entrega"
android:textColor="@color/white"
android:textSize="20sp" />
<RadioButton
android:id="@+id/radioRetirada"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.40"
android:buttonTint="@color/white"
android:gravity="center_vertical|center|start"
android:text="@string/opt_Retirada"
android:textColor="@color/white"
android:textSize="20sp" />
</RadioGroup>
<Spinner
android:id="@+id/cmbObras"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/radioGroup"
android:layout_marginTop="12dp"
android:backgroundTint="@color/white" />
<Spinner
android:id="@+id/cmbPavimento"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/cmbObras"
android:layout_marginTop="12dp"
android:backgroundTint="@color/white" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/txtDataAgendamento"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="11dp"
android:layout_toLeftOf="@+id/button1"
android:layout_toStartOf="@+id/button1"
android:background="@color/white"
android:enabled="false"
android:gravity="center_vertical|center_horizontal"
android:hint="@string/dataEntregaRetirada"
android:inputType="textCapWords"
android:maxLines="1"
android:padding="10dp"
android:textColor="@color/input_register" />
<ImageButton
android:id="@+id/button1"
android:layout_width="52dp"
android:layout_height="45dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/txtDataAgendamento"
android:layout_marginLeft="8dp"
android:background="@drawable/calendar"
android:onClick="setDate"
android:scaleType="fitXY" />
</RelativeLayout>
<EditText
android:id="@+id/txtVersaoProjeto"
android:layout_width="357dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/txtDataAgendamento"
android:layout_marginTop="14dp"
android:background="@color/white"
android:backgroundTint="@color/white"
android:ems="10"
android:gravity="top"
android:hint="@string/ultimaVersaoProjeto"
android:inputType="textMultiLine"
android:lines="1"
android:paddingLeft="10dp"
android:scrollbars="vertical" />
<EditText
android:id="@+id/txtDetalhesAgendamento"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/txtVersaoProjeto"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:background="@color/white"
android:backgroundTint="@color/white"
android:ems="10"
android:gravity="top"
android:hint="@string/detalhes"
android:inputType="textMultiLine"
android:lines="12"
android:paddingBottom="16dp"
android:paddingLeft="10dp"
android:scrollbars="vertical" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/mainLayout"
android:id="@+id/footerLayout"
android:layout_marginTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/btnNovoAgendamentos"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="16dp"
android:background="@color/btn_default_bg"
android:text="@string/btn_send"
android:textColor="@color/btn_default"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
Its working as expected. The button is bound to parentBottom, but not to anything else. That means if the screen resizes, it will float above all other content. If you want to make it stay below, you need to add an android:layout_below to the lowest piece of content in your screen.