I want a custom dialogue with close button - android

Here is the imageI have done the coding but issue is that when i open dialog,close button show only half. It only shows the portion of close button inside of relative layout.
Outside part has not been shown. I am trying from hours but still not get the solution. So if any one has idea then please help me.
Thanks in advance. !
Below is my code.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent">
<LinearLayout
android:id="#+id/relativeLayout1"
android:layout_width="255dp"
android:layout_height="385dp"
android:layout_centerInParent="true"
android:background="#android:color/white"
android:orientation="vertical" >
<Button
android:id="#+id/btn_From_Gallary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:padding="20dp"
android:layout_marginTop="60dp"
android:layout_marginBottom="16dp"
android:text="Choose From Gallary"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Take a Picture"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Send_Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Text"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<EditText
android:id="#+id/edt_notification_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:visibility="gone"
android:background="#drawable/edittext_border"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical" />
<ImageView
android:id="#+id/image"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:gravity="top|left"
android:visibility="gone"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical" />
<Button
android:id="#+id/btn_Send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:visibility="gone"
android:layout_marginRight="16dp"
android:layout_marginTop="50dp"
android:layout_marginBottom="20dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Send"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="#+id/img_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/relativeLayout1"
android:layout_alignTop="#+id/relativeLayout1"
android:layout_marginRight="-10dp"
android:layout_marginTop="-10dp"
android:src="#drawable/ic_cancel" /></RelativeLayout>

Use below code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent">
<LinearLayout
android:id="#+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#android:color/white"
android:orientation="vertical">
<Button
android:id="#+id/btn_From_Gallary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="60dp"
android:background="#color/colorAccent"
android:padding="20dp"
android:text="Choose From Gallary"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_From_Gallary"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="#color/colorAccent"
android:padding="20dp"
android:text="Take a Picture"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Send_Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_From_Gallary"
android:layout_marginBottom="20dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:background="#color/colorAccent"
android:padding="20dp"
android:text="Text"
android:textColor="#ffffff"
android:textSize="16sp" />
<EditText
android:id="#+id/edt_notification_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical"
android:visibility="gone"
android:background="#drawable/edittext_border" />
<ImageView
android:id="#+id/image"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical"
android:visibility="gone" />
<Button
android:id="#+id/btn_Send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_From_Gallary"
android:layout_marginBottom="20dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="50dp"
android:background="#color/colorAccent"
android:padding="20dp"
android:text="Send"
android:textColor="#ffffff"
android:textSize="16sp"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="#+id/img_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/relativeLayout1"
android:layout_alignTop="#+id/relativeLayout1"
android:src="#drawable/ic_cancel" />
</RelativeLayout>

Try this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="30dp"
android:layout_marginTop="57dp"
android:background="#color/colorWhite"
android:orientation="vertical">
<Button
android:id="#+id/btn_From_Gallary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:padding="20dp"
android:layout_marginTop="60dp"
android:layout_marginBottom="16dp"
android:text="Choose From Gallary"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Camera"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Take a Picture"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<Button
android:id="#+id/btn_Send_Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Text"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
<EditText
android:id="#+id/edt_notification_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:visibility="gone"
android:background="#drawable/edittext_border"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical" />
<ImageView
android:id="#+id/image"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:gravity="top|left"
android:visibility="gone"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="250"
android:maxLines="3"
android:padding="5dp"
android:scrollbars="vertical" />
<Button
android:id="#+id/btn_Send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:visibility="gone"
android:layout_marginRight="16dp"
android:layout_marginTop="50dp"
android:layout_marginBottom="20dp"
android:layout_below="#+id/btn_From_Gallary"
android:padding="20dp"
android:text="Send"
android:background="#color/colorAccent"
android:textColor="#ffffff"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="#+id/img_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="-35dp"
android:layout_marginTop="35dp"
/>
</RelativeLayout>

Related

Recycler view items auto wrapping inside scrollview

I am a newbie to android. I have Recyclerview implemented inside NestedScrollView. When I press next everything works fine, but when I return to the previous item it just wraps itself.
I have tried everything possible to make it work.
Following is the code.
For the Next & previous question, on pressing respective the following code executes
QuizAttemptFragment.xml.
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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"
android:orientation="vertical"
android:fillViewport="true"
tools:context=".view.fragments.QuizAttemptFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:descendantFocusability="beforeDescendants"
android:layout_width="match_parent"
android:id="#+id/clQuiz"
android:layout_height="match_parent">
<TextView
android:id="#+id/tvFeedBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:fontFamily="#font/nunito_regular"
tools:text="Feedback"
android:gravity="center"
android:drawablePadding="4dp"
android:drawableStart="#drawable/ic_comment_black"
android:drawableTint="#color/blackColor"
android:textSize="14sp"
android:visibility="visible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/tvAssignmentStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginTop="15dp"
android:fontFamily="#font/nunito_regular"
tools:text="Marked"
android:textSize="14sp"
android:textAllCaps="true"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionNum"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="47dp"
android:layout_marginEnd="16dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
tools:listitem="#layout/layout_num"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionDet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:visibility="gone"
android:layout_marginEnd="16dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="#+id/pbFragmentListLoading"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="56dp"
android:visibility="gone"
android:indeterminate="true"
android:indeterminateTint="#color/yellowThemeColor"
android:indeterminateTintMode="src_atop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.526"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/tvDur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="93dp"
android:drawableStart="#drawable/ic_clock_blck"
android:drawablePadding="10dp"
android:fontFamily="#font/nunito_bold"
android:gravity="center_vertical"
android:text="DD:HH:MM"
android:textColor="#000000"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.089"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteY="98dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionNew"
android:nestedScrollingEnabled="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:minHeight="300dp"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="#id/rlNav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tvDur"
app:layout_constraintVertical_bias="0.0"
tools:listitem="#layout/user_question" />
<RelativeLayout
android:id="#+id/rlNav"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="#+id/tvBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentStart="true"
android:drawablePadding="10dp"
android:drawableTint="#color/blackColor"
android:fontFamily="#font/nunito_regular"
android:gravity="center"
android:textAllCaps="true"
android:text="Previous"
android:textColor="#color/blackColor"
android:textSize="16sp"
android:visibility="invisible" />
<ImageButton
android:background="#android:color/transparent"
android:id="#+id/ibFlag"
android:visibility="visible"
android:layout_centerInParent="true"
android:src="#drawable/ic_flag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="#+id/tvNext"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:drawablePadding="10dp"
android:drawableTint="#color/blackColor"
android:fontFamily="#font/nunito_regular"
android:gravity="center"
android:textAllCaps="true"
android:text="Next"
android:textColor="#color/blackColor"
android:textSize="16sp"
android:visibility="visible" />
<androidx.cardview.widget.CardView
android:id="#+id/cvSubmit"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginEnd="5dp"
android:minWidth="80dp"
android:visibility="gone"
android:clickable="true"
android:padding="5dp"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
app:cardCornerRadius="4dp">
<LinearLayout
android:id="#+id/llCard"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/tvBtnCreateAssignmentSubmit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#584056"
android:clickable="true"
android:fontFamily="#font/nunito_regular"
android:text="Submit"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#color/whiteColor"
android:textSize="16sp"
android:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
layout_item.xml
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_marginBottom="5dp"
android:background="#fcfbfc"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/lblPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:textColor="#color/blackColor"
android:textSize="12sp"
tools:text="10 Points" />
<RelativeLayout
android:id="#+id/rlheader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:visibility="visible"
>
<TextView
android:id="#+id/lblques"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:textColor="#color/blackColor"
android:textSize="14sp"
tools:text="15." />
<TextView
android:id="#+id/tvQuestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="10dp"
android:fontFamily="#font/nunito_regular"
android:gravity="center_vertical"
android:layout_centerInParent="true"
android:layout_toStartOf="#+id/edPoint"
android:minLines="2"
tools:text="Who from the following is responsible for this question"
android:textSize="16sp"
android:scrollbars="vertical"
android:textColor="#color/blackColor" />
<TextView
android:id="#+id/tvPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:visibility="gone"
android:minLines="1"
android:textColor="#color/blackColor"
android:textSize="16sp"
tools:text="/10" />
<EditText
android:id="#+id/edPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:visibility="gone"
android:layout_centerInParent="true"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:minLines="1"
android:inputType="number"
tools:text="100"
android:imeOptions="actionDone"
android:layout_toStartOf="#+id/tvPoint"
android:textSize="14sp"
android:textColor="#color/blackColor" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlAnswer"
android:layout_marginTop="5dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:elevation="5dp"
android:background="#drawable/shape_square"
android:layout_marginBottom="20dp"
android:minHeight="100dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:padding="10dp"
android:id="#+id/edAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito_regular"
android:gravity="top"
tools:text="assfadasffdsdfddfd"
android:layout_gravity="top"
android:textSize="16sp"
android:scrollbars="vertical"
android:textColor="#color/blackColor" />
</RelativeLayout>
<LinearLayout
android:id="#+id/llOptions"
android:orientation="vertical"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:clickable="false"
android:id="#+id/llOpt1"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt1"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:clickable="false"
android:id="#+id/llOpt2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt2"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="#+id/llOpt3"
android:clickable="false"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt3"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="#+id/llOpt4"
android:clickable="false"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt4"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<androidx.cardview.widget.CardView
app:cardCornerRadius="8dp"
android:id="#+id/cvDocPreview"
android:visibility="visible"
android:layout_marginTop="4dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/llCreateAssignmentParent1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whiteColor"
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="#+id/cardImage"
app:cardElevation="0dp"
android:layout_width="#dimen/_60sdp"
android:layout_height="#dimen/_40sdp">
<ImageView
android:id="#+id/ivPreviewItem"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="match_parent"
android:minHeight="60dp"
android:src="#drawable/ic_file_black"
android:background="#color/thumbnail_background"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_toRightOf="#+id/cardImage"
android:id="#+id/llFileUpload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="5dp"
android:orientation="vertical">
<TextView
android:id="#+id/tvFileNameItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:ellipsize="end"
android:layout_marginEnd="5dp"
android:maxLines="1"
android:fontFamily="#font/nunito_bold"
android:lineSpacingExtra="0sp"
android:textColor="#000000"
android:textSize="14sp"
tools:text="Filename.ext" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tvFileType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:textColor="#000000"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_regular"
tools:text="File Type" />
<View
android:id="#+id/viewDivide"
android:layout_gravity="center"
android:background="#color/black_half"
android:layout_width="1dp"
android:layout_height="#dimen/_10sdp"/>
<TextView
android:id="#+id/tvFileSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:textColor="#000000"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginStart="4dp"
android:fontFamily="#font/nunito_regular"
android:text="24 mb" />
</LinearLayout>
</LinearLayout>
<ImageButton
android:padding="7dp"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:visibility="visible"
android:id="#+id/ibDownloadItem"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="4dp"
android:background="#color/whiteColor"
android:tint="#color/blackColor"
android:src="#android:drawable/stat_sys_download" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/tvNotAttempted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="4dp"
android:layout_gravity="center"
android:visibility="gone"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:text="Question not attempted"
android:minLines="1"
android:textColor="#color/redWarningColor"
android:textSize="16sp" />
<TextView
android:id="#+id/tvMandatory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_gravity="center"
android:visibility="gone"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:text="Mandatory Question*"
android:minLines="1"
android:textColor="#color/redWarningColor"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
Before Pressing Next
Returning to the previous item it just wraps views
Please help, I am stuck for 2 weeks

How to disable scrollview for list view and apply scrollview for entire activity containing list views and other textviews?

I have an xml file containing different buttons, textviews, list views.Listview has default scrollview which is scrolling for certain part in an activity.But how to display all the "n" cells in list view by disabling scroll view and apply scroll view for entire page containing listviews,textviews,Buttons etc
xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#edecf2"
tools:context="com.bodaty.samyata.samyata09.orders.openorderdetails">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:id="#+id/linearlayout"
tools:ignore="ScrollViewSize">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:padding="#dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="16dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:fontFamily="#font/poppinsmedium"
android:gravity="start"
android:text="#string/store_pricen"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="16sp"
tools:targetApi="n" />
<TextView
android:id="#+id/stprice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="30dp"
android:layout_marginStart="10dp" android:fontFamily="#font/montserratsemibold"
android:gravity="end"
android:lines="1"
android:layout_weight="1"
android:text="#string/price"
android:textAlignment="textEnd"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp"
android:orientation="horizontal">
<TextView
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:fontFamily="#font/poppinsmedium"
android:gravity="start"
android:text="#string/sales_tax"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="16sp"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<ListView
android:id="#+id/list"
android:layout_width="match_parent"
android:scrollbars="none"
android:layout_height="200dp"
android:background="#ffffff"
android:divider="#null"
/>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:padding="#dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:background="#drawable/ic_action_storeicon"/>
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/store_location"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="16sp"
android:fontFamily="#font/montserratsemibold"
tools:targetApi="n"
android:textStyle="bold"
android:gravity="start" />
</LinearLayout>
<TextView
android:id="#+id/st1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:layout_marginStart="20dp"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/poppinsmedium"
tools:targetApi="n"
android:gravity="start" />
<TextView
android:id="#+id/st2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/poppinsmedium"
tools:targetApi="n"
android:gravity="start" />
<TextView
android:id="#+id/st3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/poppinsmedium"
tools:targetApi="n"
android:gravity="start" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="#808080">
</View>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#ffffff"
android:id="#+id/directions">
<TextView
android:id="#+id/ic1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:background="#drawable/placeholder"
android:layout_marginStart="10dp"
android:layout_alignParentStart="true"
android:fontFamily="#font/abeezee"
android:visibility="gone"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/way_to_the_storen"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:textStyle="bold"
android:textColor="#000000"
android:textSize="16sp"
android:fontFamily="#font/abeezee"
tools:ignore="RelativeOverlap" />
<Button
android:layout_width="30dp"
android:layout_height="30dp"
android:visibility="gone"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:background="#drawable/ic_action_forearr"
android:fontFamily="#font/abeezee"
/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/phide"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:padding="#dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="2"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="horizontal">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:background="#drawable/ic_action_locationorders"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="#string/dl"
android:textAlignment="textStart"
android:textColor="#000000"
android:textSize="16sp"
android:fontFamily="#font/questrial"
tools:targetApi="n"
android:textStyle="bold"
android:gravity="start" />
</LinearLayout>
<TextView
android:id="#+id/dl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:layout_marginStart="20dp"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/questrial"
tools:targetApi="n"
android:gravity="start" />
<TextView
android:id="#+id/dl2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/questrial"
tools:targetApi="n"
android:gravity="start" />
<TextView
android:id="#+id/dl3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textAlignment="textStart"
android:textColor="#7a7a7a"
android:textSize="14sp"
android:fontFamily="#font/questrial"
tools:targetApi="n"
android:gravity="start" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:padding="#dimen/activity_horizontal_margin"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
tools:targetApi="n">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2"
android:layout_marginBottom="2dp"
android:layout_marginTop="10dp"
>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="16dp"
android:background="#drawable/truck"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/deliverymethod"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"
android:fontFamily="#font/montserratsemibold"
tools:targetApi="n"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="#string/personal_shopper"
android:textSize="16sp"
android:textColor="#000"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:id="#+id/delivery"
tools:ignore="InefficientWeight"
android:fontFamily="#font/poppinsmedium"
tools:targetApi="n"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#id/pslayout">
<TextView
android:id="#+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Personal Shopper Details"
android:layout_gravity="center_horizontal"
android:textSize="17sp"
android:textColor="#000000"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:fontFamily="#font/poppinsmedium"
tools:targetApi="n"
tools:ignore="HardcodedText,InefficientWeight" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/top"
android:visibility="gone"
>
<ImageView
android:id="#+id/dp"
android:layout_width="138dp"
android:layout_height="150dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="#drawable/usn"
android:scaleType="centerCrop"
android:contentDescription="#string/todo"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/pstrack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Track your PersonalShopper"
android:textSize="17sp"
android:layout_gravity="center"
android:textColor="#000000"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:fontFamily="#font/questrial"
tools:targetApi="n"
tools:ignore="HardcodedText,InefficientWeight" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
>
<TextView
android:id="#+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:fontFamily="#font/poppinsmedium"
android:text="#string/id1"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:id="#+id/uid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="8dp"
android:fontFamily="#font/poppinsregular"
android:text="#string/random"
android:textColor="#000000"
android:textSize="14sp"
tools:targetApi="n" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:fontFamily="#font/poppinsmedium"
android:text="#string/delivery_status"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:fontFamily="#font/poppinsregular"
android:text="#string/product_picked_up"
android:textColor="#000000"
android:textSize="14sp"
tools:ignore="InefficientWeight"
tools:targetApi="n" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</RelativeLayout>
set the height of listview to wrap_content

windowSoftInputMode doesn't working

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.
Result on edit text touch
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.

How to put this imageView in this place? - Android

I've got a problem with adding logo to my app.
Now it's like:
HERE IS A LOGO - CLICK (haven't got 10 reputation)
I want to have a imageview with logo (id: logo) above the box with login.
How to make it?
Layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:facebook="http://schemas.android.com/tools"
xmlns:fb="http://schemas.android.com/tools"
android:id="#+id/mainView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#drawable/log"
android:gravity="center"
android:orientation="vertical">
<ScrollView
android:background="#drawable/log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/social_signin_layout"
android:layout_marginTop="10dp"
android:background="#color/md_white_1000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="#+id/tv_or"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:text="#string/screen_login_or_label"
android:textColor="#color/md_black_1000"
android:textSize="24sp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_usernamelogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/screen_register_hint_email"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<!--<EditText-->
<!--android:id="#+id/"-->
<!--style="#style/edittextstyle"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/editlayimg_edittextheight"-->
<!--android:layout_marginTop="#dimen/five"-->
<!--android:gravity="bottom"-->
<!--android:hint="#string/login_storeid"-->
<!--android:singleLine="true"-->
<!--android:textColorHint="#color/fontcolorlight"-->
<!--android:textSize="18sp" />-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/one"-->
<!--android:layout_marginLeft="#dimen/five"-->
<!--android:layout_marginRight="#dimen/five"-->
<!--android:background="#color/fontcolorlight" />-->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_passwordlogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/btn_login"
style="#style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="match_parent"
android:layout_height="#dimen/btnheight"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:background="#color/material_color_accent"
android:text="#string/screen_login_button_login"
android:textColor="#color/md_white_1000"
android:textSize="#dimen/btnlogin_textsize" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/txt_signup"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="left"
android:paddingLeft="8dp"
android:text="#string/screen_login_button_sign_up"
android:textColor="#color/md_black_1000"
android:textSize="16sp"
android:layout_width="wrap_content" />
<TextView
android:id="#+id/tv_forgotpwd"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="8dp"
android:text="Forgot Password?"
android:textColor="#color/md_black_1000"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lay_above"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/md_brown_100"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<LinearLayout
android:id="#+id/social_signin_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="100dp"
android:layout_below="#+id/lay_above"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="Choose account to login"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="17sp" />
<com.google.android.gms.common.SignInButton
android:id="#+id/btn_sign_in"
android:layout_width="300dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical|center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginRight="16dp"
android:padding="0dp"
android:theme="#style/Widget.AppCompat.Button"
app:theme="#style/Widget.AppCompat.Button"
android:layout_height="35dp"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="or"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/AntiqueWhite"
android:textAlignment="center"
android:textSize="18sp"
android:id="#+id/textView10" />
<com.facebook.login.widget.LoginButton
android:id="#+id/authButton"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="300dp"
android:layout_height="50dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="#string/please_login_in"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="15sp"
android:id="#+id/textView12" />
</LinearLayout>
<TextView
android:text="Welcome, Saiyan!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:id="#+id/textView14"
android:textSize="36sp"
android:layout_below="#+id/lay_above"
android:layout_centerHorizontal="true"
android:textColor="#color/Yellow" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
just put the imageview before the relative layout
instead of:
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
do:
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
this will put imageview in the scrollview and below it the rest of the relativelayout , all because of the linearlayout orientation which directed vertical , so every child will come below the former.
EDIT :
you also need to put the scrollview first and then put the linearlayout , this should be it :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:facebook="http://schemas.android.com/tools"
xmlns:fb="http://schemas.android.com/tools"
android:background="#drawable/log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<LinearLayout
android:id="#+id/mainView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#drawable/log"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/social_signin_layout"
android:layout_marginTop="10dp"
android:background="#color/md_white_1000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="#+id/tv_or"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:text="#string/screen_login_or_label"
android:textColor="#color/md_black_1000"
android:textSize="24sp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_usernamelogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/screen_register_hint_email"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<!--<EditText-->
<!--android:id="#+id/"-->
<!--style="#style/edittextstyle"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/editlayimg_edittextheight"-->
<!--android:layout_marginTop="#dimen/five"-->
<!--android:gravity="bottom"-->
<!--android:hint="#string/login_storeid"-->
<!--android:singleLine="true"-->
<!--android:textColorHint="#color/fontcolorlight"-->
<!--android:textSize="18sp" />-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/one"-->
<!--android:layout_marginLeft="#dimen/five"-->
<!--android:layout_marginRight="#dimen/five"-->
<!--android:background="#color/fontcolorlight" />-->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_passwordlogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/btn_login"
style="#style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="match_parent"
android:layout_height="#dimen/btnheight"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:background="#color/material_color_accent"
android:text="#string/screen_login_button_login"
android:textColor="#color/md_white_1000"
android:textSize="#dimen/btnlogin_textsize" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/txt_signup"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="left"
android:paddingLeft="8dp"
android:text="#string/screen_login_button_sign_up"
android:textColor="#color/md_black_1000"
android:textSize="16sp"
android:layout_width="wrap_content" />
<TextView
android:id="#+id/tv_forgotpwd"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="8dp"
android:text="Forgot Password?"
android:textColor="#color/md_black_1000"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lay_above"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/md_brown_100"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<LinearLayout
android:id="#+id/social_signin_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="100dp"
android:layout_below="#+id/lay_above"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="Choose account to login"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="17sp" />
<com.google.android.gms.common.SignInButton
android:id="#+id/btn_sign_in"
android:layout_width="300dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical|center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginRight="16dp"
android:padding="0dp"
android:theme="#style/Widget.AppCompat.Button"
app:theme="#style/Widget.AppCompat.Button"
android:layout_height="35dp"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="or"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/AntiqueWhite"
android:textAlignment="center"
android:textSize="18sp"
android:id="#+id/textView10" />
<com.facebook.login.widget.LoginButton
android:id="#+id/authButton"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="300dp"
android:layout_height="50dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="#string/please_login_in"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="15sp"
android:id="#+id/textView12" />
</LinearLayout>
<TextView
android:text="Welcome, Saiyan!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:id="#+id/textView14"
android:textSize="36sp"
android:layout_below="#+id/lay_above"
android:layout_centerHorizontal="true"
android:textColor="#color/Yellow" />
</RelativeLayout>
</LinearLayout>
</ScrollView>

Android: layout_below and layout_alignParentBottom

So I have the following layout
ScrollView
RelativeLayout
TextView1
EditText1
TextView2
EditText2
TextView3
EditText3
TextView4
EditText4
TextView5
EditText5:
android:id="#+id/txtPassword"
LinearLayout:
android:id="#+id/Linearlayout1"
layout_alignParentBottom="true"
Button1
Button2
Here's the problem
When I click the txtPassword EditText to enter some text Button1&Button2 from the LinearLayout overlaps or becomes on top of txtPassword
Someone suggested that I use android:layout_below="#id/txtPassword" for the Linear Layout but that makes the layout_alignParentBottom="true" useless because it will put the LinearLayout right below txtPassword and not at the bottom.
EDIT: Here's the Full Layout
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/signatureScroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
android:id="#+id/signatureLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:text="#string/Meaning"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtMeaning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:enabled="false"
android:inputType="text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/txtMeaning"
android:layout_marginTop="16dp"
android:text="#string/Comments"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtSignatureComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView01"
android:layout_below="#+id/TextView01"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Comments"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/TextView01"
android:layout_below="#+id/TextView01"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<TextView
android:id="#+id/txtDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtSignatureComments"
android:layout_marginTop="16dp"
android:text="#string/Duration2"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtDuration"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<EditText
android:id="#+id/txtHours"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/imgDuration"
android:layout_marginLeft="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Hours"
android:inputType="number|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<EditText
android:id="#+id/txtMinutes"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/txtHours"
android:layout_alignParentRight="true"
android:layout_marginRight="6dp"
android:ems="10"
android:hint="#string/Minutes"
android:inputType="numberDecimal|text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtException"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtHours"
android:layout_marginTop="16dp"
android:text="#string/Exception"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtException"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/imgException"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtExceptionDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/spnrException"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtPerformance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtExceptionDesc"
android:layout_marginTop="16dp"
android:text="#string/PerformanceBased"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtPerformance"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/imgPerformance"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/spnrPerformance"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="60dp"
android:ems="10"
android:hint="#string/Username"
android:inputType="textCapCharacters|textAutoComplete"
android:singleLine="true"
android:textAllCaps="true"
android:textSize="12sp" >
</EditText>
<EditText
android:id="#+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtUsername"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="#string/Password"
android:inputType="textPassword"
android:singleLine="true"
android:textSize="12sp" />
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="#+id/btnSave"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Sign"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold" />
<Button
android:id="#+id/btnCancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Cancel"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
You might want to see if this can be fixed using different windowSoftInputMode settings. You could try to set
android:windowSoftInputMode="adjustPan" for this specific activity. It will than move up the UI if the keyboard is visible and focused on a edittext.
adjustResize can have the effect that some views overlap when the keyboard is visible.
use android:layout_below="#id/txtPassword" for the LinearLayout will work and doesn't make alignparentbottom="true" useless.
try it
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout_below="#id/txtPassword"
android:layout_alignParentBottom="true" >
When you use a Relative Layout and the Keyboard will be opened you LinearLayout will be above the keyboard
I'll suggest another solution and I think it will work:
Use a LinearLayout as parent and the last LinearLayout height fill parent and set the gravity bottom try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/signatureScroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:id="#+id/signatureLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="#string/Meaning"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtMeaning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:enabled="false"
android:inputType="text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Comments"
android:textColor="#000"
android:textSize="14sp" />
<EditText
android:id="#+id/txtSignatureComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Comments"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<ImageView
android:id="#+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<TextView
android:id="#+id/txtDuration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Duration2"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<EditText
android:id="#+id/txtHours"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="#string/Hours"
android:inputType="number|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<EditText
android:id="#+id/txtMinutes"
android:layout_width="140dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/txtHours"
android:layout_gravity="right"
android:layout_marginRight="6dp"
android:ems="10"
android:hint="#string/Minutes"
android:inputType="numberDecimal|text|textMultiLine"
android:singleLine="true"
android:textColor="#505050"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtException"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/Exception"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrException"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtExceptionDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="8dp"
android:ems="10"
android:inputType="textMultiLine"
android:maxLength="250"
android:singleLine="false"
android:textSize="14sp" >
</EditText>
<TextView
android:id="#+id/txtPerformance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="16dp"
android:text="#string/PerformanceBased"
android:textColor="#000"
android:textSize="14sp" />
<ImageView
android:id="#+id/imgPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginTop="4dp"
android:contentDescription="#string/Image"
android:scaleType="fitXY"
android:src="#drawable/line2" />
<Spinner
android:id="#+id/spnrPerformance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp" />
<EditText
android:id="#+id/txtUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="60dp"
android:ems="10"
android:hint="#string/Username"
android:inputType="textCapCharacters|textAutoComplete"
android:singleLine="true"
android:textAllCaps="true"
android:textSize="12sp" >
</EditText>
<EditText
android:id="#+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/txtUsername"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="#string/Password"
android:inputType="textPassword"
android:singleLine="true"
android:textSize="12sp" />
<LinearLayout
android:id="#+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<Button
android:id="#+id/btnSave"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Sign"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold"
android:layout_gravity="bottom"
android:gravity="bottom" />
<Button
android:id="#+id/btnCancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#drawable/button_detail_bg"
android:text="#string/Cancel"
android:textColor="#drawable/button_detail_txt"
android:textSize="16sp"
android:textStyle="bold"
android:layout_gravity="bottom"
android:gravity="bottom" />
</LinearLayout>
</LinearLayout>
</ScrollView>

Categories

Resources