0

I am having a dialog Layout for comment section when soft key board appears whole layout goes up which i don't want i want only the edit text moves up and down with key board and second thing is that when user enters multi line comments the edit text hide behind the soft keyboard.

Suppose when only one comment is there and someone is typing a comment then the first comment will go up and not visible to user.

My XML code :

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/_13sdp"
    android:layout_marginLeft="@dimen/_5sdp"
    android:layout_marginRight="@dimen/_5sdp"
    android:background="@color/backgroud_offwhite"
    android:id="@+id/rl">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/backgroud_offwhite"
    android:layout_above="@+id/vw">


    <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:id="@+id/rv"
        android:layout_marginBottom="@dimen/_10sdp">

    </android.support.v7.widget.RecyclerView>





    <TextView
        android:id="@+id/Nocomments"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAlignment="center"
        android:textColor="@color/hint_color"
        android:text="No comments yet"
        android:layout_centerInParent="true"
        android:textSize="@dimen/_16sdp"
        android:visibility="gone"/>

    <ProgressBar
        android:id="@+id/loader"
        android:layout_width="@dimen/_30sdp"
        android:layout_height="@dimen/_30sdp"
        android:layout_centerInParent="true"
        android:visibility="gone"
        android:indeterminateDrawable="@drawable/progress_bar" />

</RelativeLayout>

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/vw">

        <include
            android:id="@+id/loadItemsLayout_recyclerView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            layout="@layout/commnt_bottom_layout"
            android:visibility="gone" />

    </RelativeLayout>

    <View
        android:id="@+id/vw"
        android:layout_above="@+id/ll_send_message"
        android:layout_width="match_parent"
        android:layout_height="@dimen/_1sdp"
        android:background="@color/appColor" ></View>

    <LinearLayout
        android:id="@+id/ll_send_message"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:background="@color/backgroud_offwhite">

        <EditText
            android:id="@+id/editMessage"
            android:layout_width="0dp"
            android:hint="Write a comment..."
            android:layout_height="wrap_content"
            android:maxHeight="@dimen/_50sdp"
            android:scrollbars="vertical"
            android:layout_gravity="center_vertical|center_horizontal"
            android:layout_weight="5"
            android:textColorHint="@color/hint_color"
            android:inputType="textMultiLine|textCapSentences"
            android:backgroundTint="@android:color/transparent"
            android:scrollHorizontally="false"
            android:textCursorDrawable="@color/appColor"
            android:focusable="true"
            android:focusableInTouchMode="true"
            />

<RelativeLayout
    android:id="@+id/buttonSend"
    android:layout_width="@dimen/_50sdp"
    android:layout_height="match_parent"
    android:gravity="top"
    android:layout_marginRight="@dimen/_6sdp"
    >

        <ImageView
            android:id="@+id/sendimg"
            android:layout_width="@dimen/_20sdp"
            android:layout_height="@dimen/_20sdp"
            android:layout_centerInParent="true"
            android:background="@drawable/ic_send_button" />

    <ProgressBar
        android:id="@+id/loaderimg"
        android:layout_centerInParent="true"
        android:layout_width="@dimen/_20sdp"
        android:layout_height="@dimen/_20sdp"
        android:indeterminateDrawable="@drawable/progress_bar"
        android:visibility="gone"/>

      </RelativeLayout>
      </LinearLayout>

     </RelativeLayout>
swar
  • 1
  • 1

0 Answers0