0

At first UI is as follow Image 1

After clicking on edit TextView it comes over the keyboard Image 2

How can i achieve the same UI? Is there any library?

guipivoto
  • 18,327
  • 9
  • 60
  • 75

2 Answers2

0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".activity.ChatActivity"
    tools:showIn="@layout/activity_chat">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="50dp"
        android:scrollbars="vertical" />

    <LinearLayout
        android:background="@android:color/white"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:weightSum="4">

        <EditText android:id="@+id/message"
            android:layout_width="0dp"
            android:hint="Enter message"
            android:paddingLeft="10dp"
            android:background="@null"
            android:layout_marginRight="10dp"
            android:layout_marginLeft="16dp"
            android:lines="1"
            android:layout_height="wrap_content"
            android:layout_weight="3" />

        <Button android:id="@+id/btn_send"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@null"
            android:text="SEND"
            android:textSize="16dp"
            android:textColor="@color/colorPrimary" />

    </LinearLayout>

</RelativeLayout>
Touhidur
  • 205
  • 3
  • 8
0

Here is a GitHub repo with a tutorial on how to implement it. If you visit the XML code, you will see that similar code is done as what is offered in the comments and previous answer.

parker_codes
  • 3,267
  • 1
  • 19
  • 27