I just updated compileSdkVersion to 28 and using com.android.support:design:28.0.0
And I have a layout with couple of TextInputEditText and a MaterialButton my preview of android studio(version: 3.1.4) is different from real device(Samsung J5).
Layout Code:
<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"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
tools:context=".activity.LoginActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="#drawable/ic_movie_creation_black_24dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/app_name"
android:textAlignment="center"
android:textSize="20sp"
android:layout_marginBottom="10dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/ic_email_black_24dp"
android:layout_marginEnd="5dp"/>
<android.support.design.widget.TextInputLayout
style="#style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/emailId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:hint="Email-Id"
android:inputType="textEmailAddress" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/ic_lock_black_24dp"
android:layout_marginEnd="5dp"/>
<android.support.design.widget.TextInputLayout
style="#style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:hint="Password"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="#drawable/ic_work_black_24dp"
android:layout_marginEnd="5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ececec">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Category:"
android:textColor="#color/primaryColor"
android:layout_marginStart="12dp"
android:layout_marginTop="5dp"
android:textSize="12sp"/>
<android.support.v7.widget.AppCompatSpinner
android:id="#+id/spinner"
android:layout_width="match_parent"
android:layout_height="45dp">
</android.support.v7.widget.AppCompatSpinner>
</LinearLayout>
</LinearLayout>
<android.support.design.button.MaterialButton
android:id="#+id/btnLogin"
style="#style/Widget.MaterialComponents.Button.UnelevatedButton"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#color/primaryColor"
android:text="Login"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
Real Device Preview
Android Studio Preview
Do I have to update my android studio? Please Help
Related
I have a layout with different views. I need to move layout with header image (eye) after keyboard appearing. First I have situation like on picture 1
After clicking on Email, all layout is moving, but without header image (eye). Picture 2
Here is my xml file
<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"
android:orientation="vertical">
<ImageView
android:id="#+id/imageView"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="66dp"
android:contentDescription="TODO"
android:src="#drawable/ic_eye" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="32dp"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true">
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/no_account"
android:gravity="right"
android:layout_marginEnd="4dp"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_marginStart="4dp"
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/registration"
style="#style/TextLink"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical"
tools:ignore="UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:text="#string/entre"
android:textColor="#color/black"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
style="#style/InputWindow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintEnabled="false">
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/emailText"
android:layout_width="match_parent"
android:layout_height="50dp"
android:ellipsize="end"
android:hint="#string/email"
android:maxLines="1"
tools:ignore="KeyboardInaccessibleWidget" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/passwordLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:boxCornerRadiusBottomEnd="5dp"
app:boxCornerRadiusBottomStart="5dp"
app:boxCornerRadiusTopEnd="5dp"
app:boxCornerRadiusTopStart="5dp"
app:hintEnabled="false">
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/passwordText"
android:layout_width="match_parent"
android:layout_height="50dp"
android:drawableEnd="#drawable/ic_eye"
android:ellipsize="end"
android:hint="#string/password"
android:inputType="textPassword"
android:maxLines="1"
tools:ignore="KeyboardInaccessibleWidget" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:id="#+id/textView2"
style="#style/TextLink"
android:layout_width="109dp"
android:layout_height="33dp"
android:layout_gravity="right"
android:layout_marginEnd="4dp"
android:gravity="center"
android:text="#string/forgetPassword"
android:textSize="14sp"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="51dp"
android:layout_marginTop="16dp"
android:orientation="vertical">
<com.google.android.material.button.MaterialButton
android:id="#+id/entreBtn"
style="#style/ButtonDisable"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:enabled="false"
android:text="#string/entire"
app:cornerRadius="5dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
I can not put ImageView into main layout with EditText because ImageView must not be tied with these layouts.
I don't know what to do with this ImageView which did not move upper
The linear layout that holds the views to be below the image view using
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_below="#id/imageView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical"
tools:ignore="UselessParent">... And the rest of your views ...
<ScrollView 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/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout 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="wrap_content"
tools:context="com.example.salu.xyz.SurroundingsPropertyFragment">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<TextView
android:id="#+id/textView77"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Property Surroundings:"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="20sp"/>
<EditText
android:id="#+id/editText55"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textMultiLine"
app:layout_constraintBaseline_toBaselineOf="#+id/textView77"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView78"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="Class Of Locality:"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView77"
android:textSize="20sp"/>
<Spinner
android:id="#+id/spinner9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBaseline_toBaselineOf="#+id/textView78"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText55" />
<TextView
android:id="#+id/textView79"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="Proximities to Civic Amenities:"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView78"
android:textSize="20sp"/>
<EditText
android:id="#+id/editText57"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBaseline_toBaselineOf="#+id/textView79"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spinner9" />
<TextView
android:id="#+id/textView80"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="Neighbourhood:"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView79"
android:textSize="20sp"/>
<EditText
android:id="#+id/editText58"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBaseline_toBaselineOf="#+id/textView80"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText57" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</ScrollView>
Hi, I'm new to Android Application Development, I am creating a form in Fragment which has both TextView and EditText and I was Testing it for 5-inch screens, but the TextViewand EditText got overlapped.
I tried widgets to resize them but the alignment looks bad once I go towards higher screen size.
Is there a way this can be rectified or avoided?
use linearlayout for forms and keep the parent layout to RelativeLayout. Do something like this and your form will be fine on every device:
<ScrollView 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/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<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="wrap_content"
tools:context="com.example.salu.libravaluation.SurroundingsPropertyFragment">
<LinearLayout
android:id="#+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<TextView
android:id="#+id/textView77"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Property Surroundings:"
android:textSize="20sp" />
<EditText
android:id="#+id/editText55"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textMultiLine" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/ll1"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<TextView
android:id="#+id/textView78"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Class Of Locality:"
android:textSize="20sp" />
<Spinner
android:id="#+id/spinner9"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/ll2"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<TextView
android:id="#+id/textView79"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center|start"
android:layout_height="match_parent"
android:text="Proximities to Civic Amenities:"
android:textSize="20sp" />
<EditText
android:id="#+id/editText57"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintBaseline_toBaselineOf="#+id/textView79" />
</LinearLayout>
<LinearLayout
android:id="#+id/ll4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/ll3"
android:orientation="horizontal"
android:layout_marginBottom="10dp">
<TextView
android:id="#+id/textView80"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Neighbourhood:"
android:textSize="20sp" />
<EditText
android:id="#+id/editText58"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
I have this form and when the soft keyboard is open, the screen does not resize and dont make scroll on it.
I really want to know why. Why my view does not scroll? Why does not resize?
This is my 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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
>
<ScrollView
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="#android:color/transparent"
android:visibility="invisible"
app:navigationIcon="#drawable/ic_left_arrow"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<ImageView
android:id="#+id/imageView9"
android:layout_width="180dp"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/toolbar"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginLeft="10dp"
android:src="#drawable/logo" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imageView9"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignStart="#+id/imageView9"
android:layout_below="#+id/imageView9"
android:layout_marginLeft="15dp"
android:paddingBottom="6dp"
android:text="OFERTAR OU \nSIMULAR LANCE"
android:textColor="#eb262a"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:orientation="horizontal">
<RadioButton
android:id="#+id/livre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Lance Livre" />
<RadioButton
android:id="#+id/fixo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Lance Fixo" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Percentual do lance">
<EditText
android:id="#+id/percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/textView12"
android:layout_toStartOf="#+id/textView12"
android:ems="10"
android:inputType="numberDecimal"
android:nextFocusDown="#+id/value"
android:textSize="14dp" />
</android.support.design.widget.TextInputLayout>
<TextView
android:id="#+id/textView12"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="%"
android:textColor="#000"
android:textSize="16dp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Valor do lance">
<EditText
android:id="#+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
android:textSize="14dp" />
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:hint="Número do Protocolo">
<EditText
android:id="#+id/protocol"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:textSize="14dp" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="10">
<Button
android:id="#+id/limpar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Limpar"
android:textColor="#ffffff"
android:visibility="visible" />
<Button
android:id="#+id/simular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Simular"
android:textColor="#ffffff"
android:visibility="visible" />
<Button
android:id="#+id/registrar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Registrar"
android:textColor="#ffffff"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="#+id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:text="Lance Fixo é definido em 30%"
android:textAlignment="center"
android:textColor="#000"
android:textSize="16sp"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
</LinearLayout>
I already tried set match_parent to scrollview.
And I have this in my manifest android:windowSoftInputMode="stateAlwaysHidden|adjustResize".
If you are using "FULLSCREEN" theme for your application or activity then the "RESIZE" functionality will not work, you should use "NoTitleBar" theme without "FULLSCREEN".
It will work 100%.
And you should use "RelativeLayout" in place of parent layout(main linearlayout).
I found the problem. I'm using <item name="android:windowFullscreen">true</item>
and when the fullscreen flags are actived, the resize dont work.
If you want to resize the activity when the keyboard pops up you need to specify a line of code in manifest file inside activity tag :
android:windowSoftInputMode="adjustResize"
Refer this link for more details : https://developer.android.com/training/keyboard-input/visibility.html
You can even try to adjust screen in activity put the below code in you activity onCreate method:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Hope this should help!!
add this line to activity which you want to resize on opening soft keyboard:
android:windowSoftInputMode="adjustResize"
UPDATE POST:
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="#android:color/transparent"
android:visibility="invisible"
app:navigationIcon="#drawable/ic_left_arrow"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<ImageView
android:id="#+id/imageView9"
android:layout_width="180dp"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/toolbar"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginLeft="10dp"
android:src="#drawable/logo"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imageView9"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignStart="#+id/imageView9"
android:layout_below="#+id/imageView9"
android:layout_marginLeft="15dp"
android:paddingBottom="6dp"
android:text="OFERTAR OU \nSIMULAR LANCE"
android:textColor="#eb262a"
android:textSize="20sp"
android:textStyle="bold"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:orientation="horizontal">
<RadioButton
android:id="#+id/livre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Lance Livre"/>
<RadioButton
android:id="#+id/fixo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Lance Fixo"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/linearLayout2"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Percentual do lance">
<EditText
android:id="#+id/percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/textView12"
android:layout_toStartOf="#+id/textView12"
android:ems="10"
android:inputType="numberDecimal"
android:nextFocusDown="#+id/value"
android:textSize="14dp"/>
</android.support.design.widget.TextInputLayout>
<TextView
android:id="#+id/textView12"
android:layout_width="25dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="%"
android:textColor="#000"
android:textSize="16dp"
android:textStyle="bold"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Valor do lance">
<EditText
android:id="#+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
android:textSize="14dp"/>
</android.support.design.widget.TextInputLayout>
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/text_input_layout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:hint="Número do Protocolo">
<EditText
android:id="#+id/protocol"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:textSize="14dp"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="10">
<Button
android:id="#+id/limpar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Limpar"
android:textColor="#ffffff"
android:visibility="visible"/>
<Button
android:id="#+id/simular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Simular"
android:textColor="#ffffff"
android:visibility="visible"/>
<Button
android:id="#+id/registrar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="5"
android:backgroundTint="#android:color/holo_red_light"
android:text="Registrar"
android:textColor="#ffffff"
android:visibility="gone"/>
</LinearLayout>
<TextView
android:id="#+id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:text="Lance Fixo é definido em 30%"
android:textAlignment="center"
android:textColor="#000"
android:textSize="16sp"
android:visibility="gone"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
I am trying to add toolbar to activity but it scrolls if i am scrolling
following is the code i have tried
I need to no scroll to toolbar only contains i want to scroll. I want to design like this image how to design form like below image
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/CoordinatorLayout_login"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:fillViewport="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="vertical">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarforprofile"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#ffffff" />
<LinearLayout
android:id="#+id/profile_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="#+id/txtservicedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="#string/app_name"
android:textColor="#color/colorAccent"
android:textSize="20sp"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_requirement"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/editTextrequirement"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Your requirement?"
android:inputType="textMultiLine|textCapSentences"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Date Of Visit"
android:inputType="date"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_fortime"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Time Of Visit"
android:inputType="time"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Number Of Person You Need"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_serviceadd"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_serviceadd"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Service Address"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="2000"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btn_submit"
style="#style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit"
android:textSize="20dp"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/btnsubmit"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<!--
<ImageView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="4dp"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:scaleType="fitXY"
android:src="#drawable/logo" />
-->
<!-- <android.support.v7.widget.CardView
android:id="#+id/card_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:elevation="0dp"
app:cardBackgroundColor="#android:color/white"
app:cardElevation="4dp"
card_view:cardCornerRadius="2dp"
card_view:cardUseCompatPadding="true">-->
<!-- </android.support.v7.widget.CardView>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
[1]: https://i.stack.imgur.com/8tlhv.png
try this it will help you.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/CoordinatorLayout_login"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/MyDarkToolbarStyle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:gravity="end"
android:orientation="horizontal"
android:weightSum="8">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="8">
<TextView
android:id="#+id/txt_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="8"
android:gravity="left"
android:text="Project Edit"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarforprofile"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#ffffff" />
<LinearLayout
android:id="#+id/profile_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="#+id/txtservicedetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="#string/app_name"
android:textColor="#color/colorAccent"
android:textSize="20sp"
android:textStyle="bold" />
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_requirement"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/editTextrequirement"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Your requirement?"
android:inputType="textMultiLine|textCapSentences"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_dateofvisit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Date Of Visit"
android:inputType="date"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_fortime"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="false"
android:hint="Time Of Visit"
android:inputType="time"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_noofperson"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Number Of Person You Need"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="#+id/tl_serviceadd"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="#+id/et_serviceadd"
android:layout_width="match_parent"
android:layout_height="100dp"
android:hint="Service Address"
android:inputType="textMultiLine|textCapSentences"
android:maxLength="2000"
android:maxLines="4"
android:singleLine="true"
android:text="" />
</android.support.design.widget.TextInputLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="#+id/btn_submit"
style="#style/Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit"
android:textSize="20dp"
android:textStyle="bold" />
<ProgressBar
android:id="#+id/btnsubmit"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<!--
<ImageView
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="4dp"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:scaleType="fitXY"
android:src="#drawable/logo" />
-->
<!-- <android.support.v7.widget.CardView
android:id="#+id/card_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:elevation="0dp"
app:cardBackgroundColor="#android:color/white"
app:cardElevation="4dp"
card_view:cardCornerRadius="2dp"
card_view:cardUseCompatPadding="true">-->
<!-- </android.support.v7.widget.CardView>-->
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
layout design following this.
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/MyDarkToolbarStyle">
// Do ur custom app bar
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:gravity="end"
android:orientation="horizontal"
android:weightSum="8">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="8"
android:background="#color/colorPrimary"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="8">
<TextView
android:id="#+id/txt_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="8"
android:gravity="left"
android:text="Project Edit"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
// add ur design
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
manifest file add this theme
android:theme="#style/AppTheme.NoActionBar"
Activity Toolbar is moving up when keyboard launches
is there any problem in my layout.
Tried solutions:
Android Toolbar moves up when keyboard appears
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true"
android:background="#E0E0E0"
tools:context="com.moozup.moozup_new.activity.EditMyProfileActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/Theme.DesignDemo.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_edit_id"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary">
<TextView
android:id="#+id/text_profile_reset_id"
style="?android:actionBarTabTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginEnd="40dp"
android:drawableLeft="#android:drawable/ic_menu_rotate"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="Reset" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/edit_mtprofile_content" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_save_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
app:srcCompat="#android:drawable/ic_menu_save" />
</android.support.design.widget.CoordinatorLayout>
And Main Content is Here:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="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:paddingLeft="10dp"
android:paddingRight="10dp"
android:isScrollContainer="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="50dp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp"
android:layout_gravity="center"
tools:context=".activity.EditProfileActivity">
<android.support.v7.widget.CardView
android:id="#+id/parent_cardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="50dp"
app:cardBackgroundColor="#android:color/white"
app:cardCornerRadius="#dimen/cardview_default_radius"
app:cardElevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="80dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_first_name_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="First Name"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_last_name_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Last Name"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_email_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="email"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_designation_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Designation"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_company_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Company"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_contact_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Contact"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_address_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Address"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_description_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="About"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_talk_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Talk to me"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_linked_in_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Linked Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_facebook_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Twitter Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center">
<EditText
android:id="#+id/edit_twitter_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Twitter Url"
android:inputType="textPersonName"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Body2" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<RelativeLayout
android:id="#+id/prof"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:elevation="10dp">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/circular_edit_image_id"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center_horizontal"
android:src="#drawable/user_image"
app:finalHeight="#dimen/image_final_width"
app:finalYPosition="2dp"
app:startHeight="2dp"
app:startToolbarPosition="2dp"
app:startXPosition="2dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab_edit_camera_id"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignBottom="#id/circular_edit_image_id"
android:layout_alignEnd="#id/circular_edit_image_id"
android:scaleType="fitXY"
app:fabSize="normal"
app:layout_anchorGravity="bottom"
app:srcCompat="#drawable/ic_menu_camera" />
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Is there any problem with layout design.
Any suggestions?Thanks in advance.
Sample ScreenShot:
enter image description here
Set isScrollContainer to true
android:isScrollContainer="true"
Hope this helps :)