ScrollView between two Layouts in ConstraintLayout - android

I want to put a scrollView between two Layout and put all 3 layout in 1 constraintLayout as below :
<ConstraintLayout>
<LinearLayout> // Title
<ScrollView>
<RelativeLayout> // Buttons
<ConstraintLayout>
this in my Layout XML code :
<android.support.constraint.ConstraintLayout
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:id="#+id/registerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
app:layout_constraintRight_toRightOf="parent"
tools:context="momtaz.moshaver_yar.StudentFragment_Register">
<LinearLayout
android:id="#+id/titleLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#color/colorPrimary"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/registerStudentTitleTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="ثبت نام دانش آموز"
android:textColor="#color/colorPrimaryText"
android:textSize="20sp" />
</LinearLayout>
<ScrollView
android:id="#+id/registerStudentScroll"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#android:color/white"
android:fillViewport="true"
android:orientation="vertical"
android:scrollbars="vertical"
app:layout_constraintBottom_toTopOf="#+id/registerStudentBtn"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/titleLayout">
<LinearLayout
android:id="#+id/regstscrollayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStNameEdit"
android:text="نام و نام خانوادگی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStNameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="right|center_vertical"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerBirthDateLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="تاریخ تولد :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<TextView
android:id="#+id/registerBirthDateTxt"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#android:color/black"
android:textDirection="rtl"
android:textSize="14sp"
tools:text="10/08/1369" />
<Button
android:id="#+id/registerBirthDateBtn"
android:layout_width="28dp"
android:layout_height="28dp"
android:background="#drawable/datebtnselector" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerGenderLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="جنسیت :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="#+id/registerGenderBoy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#drawable/radiobtnselector"
android:paddingLeft="5dp"
android:text=" پسر"
android:textColor="#android:color/black"
android:textSize="16sp" />
<RadioButton
android:id="#+id/registerGenderGirl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#drawable/radiobtnselector"
android:text=" دختر"
android:textColor="#android:color/black"
android:textSize="16sp" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerMCodeLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="کد ملی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStMCodeEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerMobileLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#+id/regStPhoneEdit"
android:text="شماره تماس :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStMobileEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerPhoneLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="شماره تماس منزل :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStPhoneEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStGradeLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="پایه تحصیلی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStGradeEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#android:color/darker_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerAdviserLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStAdviserEdit"
android:text="کد مشاور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<AutoCompleteTextView
android:id="#+id/regStAdviserEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerAdviserNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStNameEdit"
android:text="نام مشاور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<TextView
android:id="#+id/regStAdviserNameTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#android:color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#android:color/darker_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUNameEdit"
android:text="نام کاربری :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUNameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUPassLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUPassEdit"
android:text="رمز عبور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUPassEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUPass2Label"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUPass2Edit"
android:text="تکرار رمز عبور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUPass2Edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/registerStudentBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<Button
android:id="#+id/regStPostBtn"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dp"
android:background="#drawable/btnselector"
android:text="ثبت"
android:textColor="#android:color/white"
android:textSize="16sp" />
<ImageView
android:id="#+id/regStProgressImg"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_toLeftOf="#+id/regStPostBtn"
android:background="#drawable/loading_animate" />
<Button
android:id="#+id/regStCancelBtn"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:background="#drawable/btnselector"
android:text="انصراف"
android:textColor="#android:color/white"
android:textSize="16sp" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
I have created this connections of constraintLayout :
Top of TitleLayout to Top of Parent
Top of ScrollView to Bottom of TitleLayout
Bottom of ScrollView to Top of ButtonLayout
Bottom of ButtonLayout to Bottom of Parent
Right and Left of All Layouts to Right and Left of Parent
There is no problem is Design-View but when I test it in GenyMotion emulator, the ButtonLayout doesn't show, it seems that the Height of ScrollView is larger than the space between bottom of TitleView and top of ButtonLayout, I can't find out whats going wrong !
I have tested NestedScrollView instead of ScrollView or RelativeLayout instead of ConstraintLayout but the problem not solved

I suggest you put the LinearLayout, ScrollView and the RelativeLayout in a vertical chain to keep them properly constrained to each other and to prevent them from overlapping. In order to create the chain you need to add a couple additional constraints:
bottom of TitleLayout to top of ScrollView
top of ButtonLayout to bottom of ScrollView
Please note that I only added two additional constraints to create a chain and did not change anything else or did not fix any other small problems with the XML:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
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:id="#+id/registerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
app:layout_constraintRight_toRightOf="parent"
tools:context="momtaz.moshaver_yar.StudentFragment_Register">
<LinearLayout
android:id="#+id/titleLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#color/colorPrimary"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="#id/registerStudentScroll"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/registerStudentTitleTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="ثبت نام دانش آموز"
android:textColor="#color/colorPrimaryText"
android:textSize="20sp" />
</LinearLayout>
<ScrollView
android:id="#+id/registerStudentScroll"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#android:color/white"
android:fillViewport="true"
android:orientation="vertical"
android:scrollbars="vertical"
app:layout_constraintBottom_toTopOf="#+id/registerStudentBtn"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/titleLayout">
<LinearLayout
android:id="#+id/regstscrollayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="rtl"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStNameEdit"
android:text="نام و نام خانوادگی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStNameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="right|center_vertical"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerBirthDateLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="تاریخ تولد :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<TextView
android:id="#+id/registerBirthDateTxt"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="#android:color/black"
android:textDirection="rtl"
android:textSize="14sp"
tools:text="10/08/1369" />
<Button
android:id="#+id/registerBirthDateBtn"
android:layout_width="28dp"
android:layout_height="28dp"
android:background="#drawable/datebtnselector" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerGenderLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="جنسیت :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="#+id/registerGenderBoy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#drawable/radiobtnselector"
android:paddingLeft="5dp"
android:text=" پسر"
android:textColor="#android:color/black"
android:textSize="16sp" />
<RadioButton
android:id="#+id/registerGenderGirl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#drawable/radiobtnselector"
android:text=" دختر"
android:textColor="#android:color/black"
android:textSize="16sp" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerMCodeLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="کد ملی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStMCodeEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerMobileLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#+id/regStPhoneEdit"
android:text="شماره تماس :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStMobileEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerPhoneLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="شماره تماس منزل :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStPhoneEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStGradeLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:text="پایه تحصیلی :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStGradeEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="phone"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#android:color/darker_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerAdviserLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStAdviserEdit"
android:text="کد مشاور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<AutoCompleteTextView
android:id="#+id/regStAdviserEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerAdviserNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStNameEdit"
android:text="نام مشاور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<TextView
android:id="#+id/regStAdviserNameTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="#android:color/black"
android:textSize="15sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TableRow
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#android:color/darker_gray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUNameLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUNameEdit"
android:text="نام کاربری :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUNameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUPassLabel"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUPassEdit"
android:text="رمز عبور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUPassEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="#+id/registerStUPass2Label"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="left"
android:labelFor="#id/regStUPass2Edit"
android:text="تکرار رمز عبور :"
android:textColor="#android:color/black"
android:textSize="15sp" />
<EditText
android:id="#+id/regStUPass2Edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/editselector"
android:gravity="left|center_vertical"
android:inputType="number"
android:padding="3dp"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/registerStudentBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="#id/registerStudentScroll"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<Button
android:id="#+id/regStPostBtn"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dp"
android:background="#drawable/btnselector"
android:text="ثبت"
android:textColor="#android:color/white"
android:textSize="16sp" />
<ImageView
android:id="#+id/regStProgressImg"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_toLeftOf="#+id/regStPostBtn"
android:background="#drawable/loading_animate" />
<Button
android:id="#+id/regStCancelBtn"
android:layout_width="80dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:background="#drawable/btnselector"
android:text="انصراف"
android:textColor="#android:color/white"
android:textSize="16sp" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>

Related

Cancel image or button on the top of the view android

Hi,
I am trying to create Cancel button on top of the view like in above image.while scroll also image should be still. i have used Floating button.Cancel image is coming as normal but floating round background still coming in the background.i want to remove it.how to remove it or any other way to do it.
Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.ProductDetailsSingleActivity">
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/cancel_image"
android:layout_alignParentTop="true"
style="?android:attr/borderlessButtonStyle"
android:background="#android:color/transparent"
app:rippleColor="#null"
app:backgroundTint="#null"
android:src="#drawable/cancel1" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/cancel_image">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/imageView1"
android:layout_margin="10dp"
android:layout_width="300dp"
android:layout_height="200dp"
android:src="#drawable/con_pump5"
android:layout_centerHorizontal="true"
/>
<LinearLayout
android:id="#+id/ll_album_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_below="#id/imageView1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="8dp"
android:paddingTop="8dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/ll_media_count"
android:orientation="horizontal">
<TextView
android:id="#+id/rupees"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="4dp"
android:paddingRight="4dp"
android:maxLines="1"
android:text="Rs.12,00,000"
android:textColor="#color/colorBlack"
android:textSize="14sp" />
<ImageView
android:id="#+id/album_media_label"
android:layout_width="20dp"
android:text="media"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="#drawable/outline_favorite_border_black_18" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical">
<TextView
android:id="#+id/decription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:text="Silos for selling with good condi.."
android:textColor="#color/colorBlack"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="#drawable/location2"/>
<TextView
android:id="#+id/location"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:maxLines="1"
android:ellipsize="end"
android:text="Bangalore,Karnataka"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:id="#+id/view_line"
android:layout_width="match_parent"
android:layout_below="#+id/ll_album_info"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/des_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_below="#+id/view_line"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description :"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#android:color/black"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/des"
android:textSize="15sp"
android:textColor="#color/colorBlack"
/>
</LinearLayout>
<View
android:id="#+id/view_line2"
android:layout_width="match_parent"
android:layout_below="#+id/des_linear"
android:layout_height="1dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/detail_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_below="#+id/view_line2"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Details :"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#android:color/black"/>
</LinearLayout>
<LinearLayout
android:id="#+id/last_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_below="#+id/detail_linear"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_FeeType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/company_name"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_name_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/company_name1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_FeeAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/contact_person"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_class_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/contact_person1"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_reg_no"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/mobile_no"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_reg_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/mobile_no1"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_class_teacher"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="#string/landline_no"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_class_teacher_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/landline_no"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_birth_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/address"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_birth_date_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/address1"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="#+id/text_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/location"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:id="#+id/text_address_Val"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/location1"
android:textColor="#color/colorBlack"
android:textSize="15sp"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/model_of_year"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/model_of_year1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/serial_number"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/serial_number1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/new_machine_cost"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/new_machine_cost1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/expecting_cost"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/expecting_cost1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp"
android:gravity="center_vertical"
android:text="#string/comments"
android:textSize="15sp"
android:textColor="#color/colorBlack"
android:textStyle="normal" />
</LinearLayout>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="#string/comments1"
android:textSize="15sp"
android:textColor="#color/colorBlack" />
</LinearLayout>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:textColor="#color/colorBlack"
android:layout_below="#+id/last_linear"
android:text="CHAT"/>
</RelativeLayout>
</ScrollView>
Do like this way: First, add the Scroll view in the parent layout with attribute align parent top as true. Then below Scrollview, you can add the cancel button also have attribute align parent top as true.

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

Not able to scroll my Linear Layout using ScrollView?

This is my XML file for presenting the Layout.
edit_screen.xml
<?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:background="#drawable/login_bg">
<LinearLayout
android:id="#+id/ll_userregisteration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="30dp"
android:isScrollContainer="true"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp">
<com.shout.networking.view.RoundedImageView
android:id="#+id/profile_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:scaleType="center"
android:src="#drawable/profile_placeholder"/>
<ImageButton
android:id="#+id/camera"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="What do we call you"
android:textColor="#color/white"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="#+id/et_reg_Fname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:textSize="16sp"
android:layout_weight="1"
android:backgroundTint="#color/white"
android:hint="first name"
android:textColor="#color/white"
android:textColorHint="#7c7875" />
<EditText
android:id="#+id/et_reg_Lname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_weight="1"
android:textSize="16sp"
android:backgroundTint="#color/white"
android:hint="last name"
android:textColor="#color/white"
android:textColorHint="#7c7875" />
</LinearLayout>
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<RadioButton
android:id="#+id/rb_male"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="#null"
android:checked="true"
android:drawableLeft="#drawable/selector_radio_button"
android:drawablePadding="10dp"
android:text="Male"
android:textColor="#android:color/white"
android:textSize="18sp" />
<RadioButton
android:id="#+id/rb_female"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="#null"
android:checked="false"
android:drawableLeft="#drawable/selector_radio_button"
android:drawablePadding="10dp"
android:text="Female"
android:textColor="#android:color/white"
android:textSize="18sp" />
</RadioGroup>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="School of your cool"
android:textColor="#color/white"
android:textSize="18sp" />
<EditText
android:id="#+id/et_university"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#color/white"
android:textSize="14sp"
android:hint="add your university"
android:textColor="#color/white"
android:textColorHint="#7c7875" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="what you call home"
android:textColor="#color/white"
android:textSize="18sp" />
<EditText
android:id="#+id/et_livingaddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#color/white"
android:hint="Where do you live now"
android:textColor="#color/white"
android:textSize="16sp"
android:textColorHint="#7c7875" />
<EditText
android:id="#+id/et_permanentaddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#color/white"
android:hint="Where do you belong to"
android:textSize="16sp"
android:textColor="#color/white"
android:textColorHint="#7c7875" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Whats Your Calling"
android:textColor="#color/white"
android:textSize="18sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/et_interset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#color/white"
android:layout_toLeftOf="#+id/sp_interset"
android:hint="Type in your calling/pick from the list"
android:textSize="16sp"
android:maxLength="30"
android:textColor="#color/white"
android:textColorHint="#7c7875"
android:maxLines="1" />
<Spinner
android:id="#+id/sp_interset"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:background="#drawable/down_thicker"
android:dropDownWidth="250dp"
android:backgroundTint="#android:color/white"
android:popupBackground="#4b4b49"
android:spinnerMode="dropdown" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:layout_marginTop="10dp">
<Button
android:id="#+id/btn_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/selector_signup_button"
android:text="CANCEL"
android:layout_marginRight="20dp"
android:textColor="#color/black"
android:layout_weight="1"
android:textSize="15sp" />
<Button
android:id="#+id/btn_save"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/selector_signup_button"
android:text="SAVE"
android:textColor="#color/black"
android:layout_weight="1"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
This is the screenshot for my Layout.I am not able to scroll it.
I have put my Linear LAyout in the ScrollView but then also i am unable to get the scroll functionality in my xml design .
make changes in LinearLayout height to match_parent. it will work.
In ScrollView try adding this line:
app:layout_behavior="#string/appbar_scrolling_view_behavior"

How to avoid keyboard block screen using scroll view (using adjustResize)

My question may be [duplicate] i try all solutions but nothing work.
Activity declare in manifest
I am using adjustResize but its not work . i try adjustPan and other option but no one works.
<activity
android:name=".NotesActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"></activity>
XML screen code
I am using scroll view but still cant prevent screen blockage .
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
android:fitsSystemWindows="false"
android:focusable="true"
android:focusableInTouchMode="true">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:theme="#style/AppTheme">
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#color/colorwhite"
android:textSize="18sp" />
</android.support.v7.widget.Toolbar>
<View
android:id="#+id/sep"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/toolbar"
android:background="#color/colorwhite" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/sep"
android:background="#color/colorPrimaryDark"
android:fillViewport="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="15dp"
android:scrollbars="none">
<LinearLayout
android:id="#+id/llayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Medical Certificate Issued:"
android:textColor="#color/colorwhite"
android:textSize="16sp" />
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/round_edittext"
android:orientation="horizontal"
android:padding="8dp"
android:theme="#style/AppTheme3">
<RadioButton
android:id="#+id/radio_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:buttonTint="#color/colorblack"
android:onClick="onRadioButtonClicked"
android:paddingRight="10dp"
android:text="Yes"
android:textSize="18sp"
android:theme="#style/AppTheme3" />
<RadioButton
android:id="#+id/radio_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:buttonTint="#color/colorblack"
android:checked="true"
android:onClick="onRadioButtonClicked"
android:text="No"
android:textSize="18sp"
android:theme="#style/AppTheme3" />
</RadioGroup>
<LinearLayout
android:id="#+id/certificate_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:padding="25dp"
android:weightSum="2">
<TextView
android:id="#+id/certificate_from"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="#drawable/round_edittext"
android:gravity="center_vertical|left"
android:maxLines="1"
android:minLines="1"
android:paddingBottom="8dp"
android:paddingLeft="5dp"
android:paddingTop="8dp"
android:text="From"
android:textColor="#color/colorblack" />
<TextView
android:id="#+id/certificate_to"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="#drawable/round_edittext"
android:gravity="center_vertical|left"
android:maxLines="1"
android:minLines="1"
android:paddingBottom="8dp"
android:paddingLeft="5dp"
android:paddingTop="8dp"
android:text="To"
android:textColor="#color/colorblack" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Follow up required:"
android:textColor="#color/colorwhite"
android:textSize="16sp" />
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/round_edittext"
android:orientation="horizontal"
android:padding="8dp"
android:theme="#style/AppTheme3">
<RadioButton
android:id="#+id/radio_follow_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:buttonTint="#color/colorblack"
android:paddingRight="10dp"
android:text="Yes"
android:textSize="18sp"
android:theme="#style/AppTheme3" />
<RadioButton
android:id="#+id/radio_follow_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:buttonTint="#color/colorblack"
android:checked="true"
android:text="No"
android:textSize="18sp"
android:theme="#style/AppTheme3" />
</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="#drawable/round_edittext"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:weightSum="3">
<CheckBox
android:id="#+id/checkbox_sc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_weight="1.1"
android:buttonTint="#color/colorblack"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="SC"
android:theme="#style/AppTheme3" />
<CheckBox
android:id="#+id/checkbox_p"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="1.1"
android:buttonTint="#color/colorblack"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="P"
android:theme="#style/AppTheme3" />
<CheckBox
android:id="#+id/checkbox_pt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="0.8"
android:buttonTint="#color/colorblack"
android:ems="3"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="PT"
android:theme="#style/AppTheme3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/round_edittext"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:weightSum="3">
<CheckBox
android:id="#+id/checkbox_rfb"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_weight="1.1"
android:buttonTint="#color/colorblack"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="RFB"
android:theme="#style/AppTheme3" />
<CheckBox
android:id="#+id/checkbox_path"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_weight="1.1"
android:buttonTint="#color/colorblack"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="PATH"
android:theme="#style/AppTheme3" />
<CheckBox
android:id="#+id/checkbox_ref"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_weight="0.8"
android:buttonTint="#color/colorblack"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="REF"
android:theme="#style/AppTheme3" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/edit"
android:text="Your Signature:"
android:textColor="#color/colorwhite"
android:textSize="16sp" />
<TextView
android:id="#+id/remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:background="#drawable/round_line"
android:ems="5"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="8dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="8dp"
android:text="Remove"
android:textColor="#color/colorwhite" />
<TextView
android:id="#+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="#+id/remove"
android:background="#drawable/round_line"
android:ems="5"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="8dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="8dp"
android:text="Edit"
android:textColor="#color/colorwhite" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/round_edittext">
<TextView
android:id="#+id/add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:minLines="7"
android:text="Add your signature!"
android:textColor="#color/colorblack"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/signature_img"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_alignBottom="#+id/add"
android:layout_alignLeft="#+id/add"
android:layout_alignRight="#+id/add"
android:layout_alignTop="#+id/add" />
</RelativeLayout>
<Button
android:id="#+id/submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/round_green"
android:gravity="center"
android:maxLines="1"
android:paddingBottom="8dp"
android:paddingLeft="5dp"
android:paddingTop="8dp"
android:text="Submit"
android:textColor="#color/colorwhite"
android:textSize="18sp" />
</LinearLayout>
</ScrollView>
<ProgressBar
android:id="#+id/login_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginBottom="8dp"
android:visibility="gone" />
Try adding alignParentBottom to your ScrollView. So when your parent will be stretched, the ScrollView will follow and be stretched as well. Let me know if that works!
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/sep"
android:layout_alignParentBottom="true"
android:background="#color/colorPrimaryDark"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="15dp"
android:scrollbars="none">
i use just
android:windowSoftInputMode="stateHidden|adjustResize"
and it works in my applications

Android Java How to make half screen keyboard and done in the edit text at the same time?

I want to make an EditText that its keyboard fills half screen in Landscape mode but also to have the done available at the same time since I have more than one EditText in my layout.
How can I use
android:imeOptions="flagNoExtractUi"
and
android:imeOptions="actionDone"
at the same time!!!
Here is the code:
<?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"
tools:context="com.example.ommabdelhafiz.amathmess.MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="16sp"
android:id="#+id/first_1st"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="×"
android:textSize="16sp"
/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="16sp"
android:id="#+id/first_2nd"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="16sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:inputType="number"
android:maxLength="3"
android:hint=" "
android:id="#+id/first_ans"
android:imeOptions="flagNoExtractUi"
android:layout_marginRight="20dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="#+id/first_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="#+id/first_false_ans"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check"
android:layout_marginLeft="20dp"
android:onClick="check1st"
android:id="#+id/first_btn"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="49"
android:textSize="16sp"
android:id="#+id/second_1st"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="÷"
android:textSize="16sp"
/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="16sp"
android:id="#+id/second_2nd"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="16sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:inputType="number"
android:maxLength="2"
android:hint=" "
android:id="#+id/second_ans"
android:imeOptions="flagNoExtractUi"
android:layout_marginRight="20dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="#+id/second_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="#+id/second_false_ans"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check"
android:layout_marginLeft="20dp"
android:onClick="check2nd"
android:id="#+id/second_btn"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="711"
android:textSize="16sp"
android:id="#+id/third_1st"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="×"
android:textSize="16sp"
/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="7"
android:textSize="16sp"
android:id="#+id/third_2nd"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="16sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:inputType="number"
android:maxLength="4"
android:hint=" "
android:id="#+id/third_ans"
android:imeOptions="flagNoExtractUi"
android:layout_marginRight="20dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="#+id/third_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="#+id/third_false_ans"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check"
android:layout_marginLeft="20dp"
android:onClick="check3rd"
android:id="#+id/third_btn"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="41.735"
android:textSize="16sp"
android:id="#+id/fourth_1st"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="+"
android:textSize="16sp"
/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="23.836"
android:textSize="16sp"
android:id="#+id/fourth_2nd"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="16sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:inputType="numberDecimal"
android:hint=" "
android:maxLength="7"
android:id="#+id/fourth_ans"
android:imeOptions="flagNoExtractUi"
android:layout_marginRight="20dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="#+id/fourth_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="#+id/fourth_false_ans"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check"
android:layout_marginLeft="20dp"
android:onClick="check4th"
android:id="#+id/fourth_btn"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="71.159"
android:textSize="16sp"
android:id="#+id/fifth_1st"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="-"
android:textSize="16sp"
/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="14.704"
android:textSize="16sp"
android:id="#+id/fifth_2nd"/>
<TextView
android:layout_width="70dp"
android:layout_height="wrap_content"
android:text="="
android:textSize="16sp"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:inputType="numberDecimal"
android:maxLength="7"
android:hint=" "
android:id="#+id/fifth_ans"
android:imeOptions="flagNoExtractUi"
android:layout_marginRight="20dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:layout_gravity="center_horizontal"
android:id="#+id/fifth_true_ans"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="16dp"
android:gravity="bottom"
android:layout_gravity="center_horizontal"
android:id="#+id/fifth_false_ans"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check"
android:layout_marginLeft="20dp"
android:onClick="check5th"
android:id="#+id/fifth_btn"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
You can combine imeOptions with a | (pipe)
android:imeOptions="flagNoExtractUi|actionDone"

Categories

Resources