Here is a layout for sign up and login. How do I make only the sign up form scrollable especially for small screens? I tried adding ScrollView but it doesn't seem to work. I'm using TabLayout to change between fragments. The FrameLayout with id "container_frame" is inflated with the fragment layout. Here is my XML layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:id="#+id/frameLayout_top"
android:layout_width="match_parent"
android:layout_height="match_parent"
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"
tools:context=".RegisterActivity">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/mother_daughter" />
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/txtview_please_sign_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:text="#string/PLEASE_SIGN_UP"
android:textColor="#color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/to_add_your_review"
android:textColor="#color/white"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="#+id/txtview_please_sign_up"
app:layout_constraintTop_toBottomOf="#+id/txtview_please_sign_up" />
<Button
android:id="#+id/facebook"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:background="#3b5998"
android:minWidth="64dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="#string/log_in_with_facebook"
android:textColor="#color/white"
android:textSize="12sp"
android:theme="#style/Theme.MaterialComponents"
app:layout_constraintEnd_toStartOf="#+id/Google"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView5" />
<Button
android:id="#+id/Google"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="#D44638"
android:minWidth="64dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="#string/log_in_with_google"
android:textColor="#color/white"
android:textSize="12sp"
android:theme="#style/Theme.MaterialComponents"
app:layout_constraintBottom_toBottomOf="#+id/facebook"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/facebook"
app:layout_constraintTop_toTopOf="#+id/facebook"
app:layout_constraintVertical_bias="0.0" />
<View
android:id="#+id/divider1"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginStart="8dp"
android:background="#color/white"
app:layout_constraintBottom_toBottomOf="#+id/textView6"
app:layout_constraintEnd_toStartOf="#+id/textView6"
app:layout_constraintStart_toStartOf="#+id/facebook"
app:layout_constraintTop_toTopOf="#+id/textView6" />
<View
android:id="#+id/divider2"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginEnd="8dp"
android:background="#color/white"
app:layout_constraintBottom_toBottomOf="#+id/textView6"
app:layout_constraintEnd_toEndOf="#+id/Google"
app:layout_constraintStart_toEndOf="#+id/textView6"
app:layout_constraintTop_toTopOf="#+id/textView6" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
android:text="#string/or"
android:textColor="#color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="#+id/divider2"
app:layout_constraintStart_toEndOf="#+id/divider1"
app:layout_constraintTop_toBottomOf="#+id/Google" />
<LinearLayout
android:id="#+id/frameLayout_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView6"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:theme="#style/CustomTabLayout"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="56dp">
<android.support.design.widget.TabItem
android:id="#+id/tabItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/login" />
<android.support.design.widget.TabItem
android:id="#+id/tabItem2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/sign_up" />
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<!--<android.support.v4.view.ViewPager
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintTop_toBottomOf="#id/appbar" />-->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<FrameLayout
android:id="#+id/container_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/appbar"
app:layout_constraintBottom_toTopOf="parent"
/>
</ScrollView>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</FrameLayout>
The screenshots are here
Here is my fragment layout which is inflated to the FrameLayout of above layout.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
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=".SignUpFragment"
app:cardUseCompatPadding="true"
app:cardElevation="4dp"
app:cardCornerRadius="3dp"
android:layout_marginBottom="16dp"
>
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="16dp">
<TextView
android:id="#+id/textViewname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="#string/name1"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/signup_name"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:hint="#string/enter_your_name"
android:inputType="text"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/textViewname"
app:layout_constraintTop_toBottomOf="#+id/textViewname" />
<TextView
android:id="#+id/textViewemail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/email2"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewname"
app:layout_constraintTop_toBottomOf="#+id/signup_name" />
<EditText
android:id="#+id/signup_email"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textEmailAddress"
android:hint="#string/enter_your_email"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_name"
app:layout_constraintStart_toStartOf="#+id/signup_name"
app:layout_constraintTop_toBottomOf="#+id/textViewemail" />
<TextView
android:id="#+id/textViewpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/password"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewemail"
app:layout_constraintTop_toBottomOf="#+id/signup_email" />
<EditText
android:id="#+id/signup_password"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textPassword"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_email"
app:layout_constraintStart_toStartOf="#+id/signup_email"
app:layout_constraintTop_toBottomOf="#+id/textViewpassword" />
<TextView
android:id="#+id/textViewconfirmpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/confirm_password"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewpassword"
app:layout_constraintTop_toBottomOf="#+id/signup_password" />
<EditText
android:id="#+id/signup_confirmpassword"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textPassword"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_password"
app:layout_constraintStart_toStartOf="#+id/signup_password"
app:layout_constraintTop_toBottomOf="#+id/textViewconfirmpassword" />
<Button
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:background="#color/colorPrimaryDark"
android:text="#string/sign_up"
android:textColor="#color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="#+id/signup_confirmpassword"
app:layout_constraintStart_toStartOf="#+id/signup_confirmpassword"
app:layout_constraintTop_toBottomOf="#+id/signup_confirmpassword" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
Just put ScrollView as parent of ConstraintLayout as follows
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
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=".SignUpFragment"
app:cardUseCompatPadding="true"
app:cardElevation="4dp"
app:cardCornerRadius="3dp"
android:layout_marginBottom="16dp"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="16dp">
<TextView
android:id="#+id/textViewname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="#string/name1"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/signup_name"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:hint="#string/enter_your_name"
android:inputType="text"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/textViewname"
app:layout_constraintTop_toBottomOf="#+id/textViewname" />
<TextView
android:id="#+id/textViewemail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/email2"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewname"
app:layout_constraintTop_toBottomOf="#+id/signup_name" />
<EditText
android:id="#+id/signup_email"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textEmailAddress"
android:hint="#string/enter_your_email"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_name"
app:layout_constraintStart_toStartOf="#+id/signup_name"
app:layout_constraintTop_toBottomOf="#+id/textViewemail" />
<TextView
android:id="#+id/textViewpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/password"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewemail"
app:layout_constraintTop_toBottomOf="#+id/signup_email" />
<EditText
android:id="#+id/signup_password"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textPassword"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_email"
app:layout_constraintStart_toStartOf="#+id/signup_email"
app:layout_constraintTop_toBottomOf="#+id/textViewpassword" />
<TextView
android:id="#+id/textViewconfirmpassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/confirm_password"
android:textColor="#color/grey"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="#+id/textViewpassword"
app:layout_constraintTop_toBottomOf="#+id/signup_password" />
<EditText
android:id="#+id/signup_confirmpassword"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:inputType="textPassword"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/signup_password"
app:layout_constraintStart_toStartOf="#+id/signup_password"
app:layout_constraintTop_toBottomOf="#+id/textViewconfirmpassword" />
<Button
android:layout_width="0dp"
android:layout_height="36dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:background="#color/colorPrimaryDark"
android:text="#string/sign_up"
android:textColor="#color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="#+id/signup_confirmpassword"
app:layout_constraintStart_toStartOf="#+id/signup_confirmpassword"
app:layout_constraintTop_toBottomOf="#+id/signup_confirmpassword" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
</android.support.v7.widget.CardView>
Related
I have an application with a main layout, where I have several LinearLayout, all within a RelativeLayout, I'm using Elevation on LineareLayout´s, and it seems that RelativeLayout does not occupy the entire screen.
I've tried all the available layout types, but the result is always the same, I need help.
The code is just a sample of my structure.
this is the result of my relative layout
<?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:id="#+id/LayoutPrincipal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/tolbarInitManut"
layout="#layout/custom_toolbar"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="136dp" />
<ScrollView
android:id="#+id/scrollViewInitManut"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/tolbarInitManut">
<android.support.constraint.ConstraintLayout
android:id="#+id/initManutencao"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".initManutencao">
<TextView
android:id="#+id/txt_Cliente"
android:layout_width="155dp"
android:layout_height="27dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/calibri"
android:gravity="left|start"
android:text="#string/cliente"
app:autoSizeMaxTextSize="100sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/Manutencao"
tools:ignore="RtlHardcoded" />
<TextView
android:id="#+id/Manutencao"
android:layout_width="0dp"
android:layout_height="26dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:orientation="horizontal"
android:text="#string/txt_manutencao"
android:textAlignment="textEnd"
app:autoSizeMaxTextSize="100sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toStartOf="#+id/Nmanutencao"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/Nmanutencao"
android:layout_width="36dp"
android:layout_height="0dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:text="#string/_10"
android:textAlignment="center"
android:textStyle="bold"
app:autoSizeMaxTextSize="100sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
app:layout_constraintBottom_toBottomOf="#+id/Manutencao"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/Manutencao"
app:layout_constraintTop_toTopOf="#+id/Manutencao" />
<LinearLayout
android:id="#+id/passo1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="#drawable/background_shape"
android:elevation="1.5dp"
android:orientation="vertical"
android:paddingTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_Cliente">
<TextView
android:id="#+id/PreTratamento"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:gravity="center"
android:padding="0dp"
android:text="#string/PreTratamento"
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/back_header_alert" />
<View
android:id="#+id/view1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:background="#android:color/darker_gray" />
<LinearLayout
android:id="#+id/passo1_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
android:id="#+id/CaixaDeGordura"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:text="#string/caixa_de_gordura"
android:textSize="30sp" />
<LinearLayout
android:id="#+id/passo1_1_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<Spinner
android:id="#+id/spn_ex_cx_gordura"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#drawable/spinner_border"
android:popupBackground="#drawable/background_shape"
android:spinnerMode="dropdown" />
</LinearLayout>
<LinearLayout
android:id="#+id/passo1_1_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
android:visibility="gone">
<Spinner
android:id="#+id/spn_projeto_sub"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:popupBackground="#drawable/background_shape" />
<EditText
android:id="#+id/txt_obs_cx_gordura"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:ems="10"
android:fontFamily="#font/calibri"
android:hint="#string/txt_obs_cx_gordura"
android:inputType="textPersonName"
tools:targetApi="o" />
<LinearLayout
android:id="#+id/btn_im_cx_gord"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#drawable/backgroud_button"
android:onClick="openAlertDialog"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<ImageView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="34dp"
android:layout_height="29dp"
android:background="#0000"
android:clickable="false"
android:src="#drawable/ic_photo_camera_black_24dp" />
<TextView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0000"
android:clickable="false"
android:text="#string/camera"
android:textColor="#color/WhiteColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/passo1_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
android:id="#+id/gradeamento"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:text="#string/gradeamento"
android:textSize="30sp" />
<LinearLayout
android:id="#+id/passo1_2_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<Spinner
android:id="#+id/spn_ex_grad"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
</LinearLayout>
<LinearLayout
android:id="#+id/passo1_2_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
android:visibility="gone">
<Spinner
android:id="#+id/spn_mod_grad"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_st_grad"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_pres_gordura_grad"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_res_pros_prod_grad"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<EditText
android:id="#+id/txt_obs_cx_grad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:ems="10"
android:fontFamily="#font/calibri"
android:hint="#string/txt_obs_cx_gordura"
android:inputType="textPersonName"
tools:targetApi="o" />
<LinearLayout
android:id="#+id/btn_im_grad"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#drawable/backgroud_button"
android:onClick="openAlertDialog"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<ImageView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="34dp"
android:layout_height="29dp"
android:background="#0000"
android:clickable="false"
android:src="#drawable/ic_photo_camera_black_24dp" />
<TextView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0000"
android:clickable="false"
android:text="#string/camera"
android:textColor="#color/WhiteColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/passo1_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp">
<TextView
android:id="#+id/cesto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:fontFamily="#font/calibri"
android:text="Cesto"
android:textSize="30sp" />
<LinearLayout
android:id="#+id/passo1_3_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<Spinner
android:id="#+id/spn_ex_cesto"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
</LinearLayout>
<LinearLayout
android:id="#+id/passo1_3_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
android:visibility="gone">
<Spinner
android:id="#+id/spn_mod_cesto"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_st_cest"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_pres_gordura_cest"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<Spinner
android:id="#+id/spn_res_pros_prod_cest"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:background="#drawable/spinner_border"
android:fontFamily="#font/calibri" />
<EditText
android:id="#+id/txt_obs_cx_cest"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:ems="10"
android:fontFamily="#font/calibri"
android:hint="#string/txt_obs_cx_cesto"
android:inputType="textPersonName" />
<LinearLayout
android:id="#+id/btn_im_cest"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#drawable/backgroud_button"
android:onClick="openAlertDialog"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<ImageView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="34dp"
android:layout_height="29dp"
android:background="#0000"
android:clickable="false"
android:src="#drawable/ic_photo_camera_black_24dp" />
<TextView
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#0000"
android:clickable="false"
android:text="#string/camera"
android:textColor="#color/WhiteColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<TextView
android:id="#+id/txt_passo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="#+id/txt_Cliente"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/txt_Cliente"
app:layout_constraintTop_toTopOf="#+id/txt_Cliente" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
In your scroll view , you need to add android:fillViewPort="true"
To fit the content inside scrollview to occupy whole screen.
I'm currently practicing UI designing in Android and needed to make a layout be included in multiple layouts as a header. So I made this quite complex layout below.
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f5f5f5">
<include
android:id="#+id/includeItem"
layout="#layout/dialog_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_marginTop="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/includeItem">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<android.support.constraint.Guideline
android:id="#+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<EditText
android:id="#+id/editText4"
style="#style/CustomEditText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:ems="10"
android:hint="#string/name"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/imageView5"
app:layout_constraintTop_toTopOf="#+id/imageView5" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#color/btn_bg" />
<Button
android:id="#+id/button4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#drawable/border_transparent_bg"
android:drawableRight="#drawable/ic_chevron_right_black_24dp"
android:gravity="start|center_vertical"
android:padding="8dp"
android:text="#string/select_category"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="#+id/editText4"
app:layout_constraintStart_toStartOf="#+id/editText4"
app:layout_constraintTop_toBottomOf="#+id/editText4" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/tap_to_edit"
android:textColor="#color/textDarkSecondary"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="#+id/imageView5"
app:layout_constraintStart_toStartOf="#+id/imageView5"
app:layout_constraintTop_toBottomOf="#+id/imageView5" />
<TableRow
android:id="#+id/tableRow4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#drawable/border_transparent_bg"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="#+id/tableRow3"
app:layout_constraintStart_toStartOf="#+id/tableRow3"
app:layout_constraintTop_toBottomOf="#+id/tableRow3">
<EditText
android:id="#+id/editText7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:background="#color/white"
android:ems="10"
android:hint="#string/price"
android:inputType="textPersonName"
android:padding="8dp"
android:textSize="24sp" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_weight="1"
android:background="#color/white"
android:ems="10"
android:hint="#string/sku"
android:inputType="textPersonName"
android:padding="8dp"
android:textSize="24sp" />
</TableRow>
<TextView
android:id="#+id/textView11"
style="#style/ModuleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="#string/variations"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView10" />
<TableRow
android:id="#+id/tableRow3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="#drawable/border_transparent_bg"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/textView11"
app:layout_constraintTop_toBottomOf="#+id/textView11">
<EditText
android:id="#+id/editText8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/white"
android:ems="10"
android:hint="#string/name"
android:inputType="textPersonName"
android:padding="8dp"
android:textSize="24sp" />
</TableRow>
<Button
android:id="#+id/button6"
style="#style/CommonButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="#string/add_variation"
app:layout_constraintEnd_toEndOf="#+id/tableRow4"
app:layout_constraintStart_toStartOf="#+id/tableRow4"
app:layout_constraintTop_toBottomOf="#+id/tableRow4" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/add_variation_msg"
android:textColor="#color/textDarkSecondary"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="#+id/button6"
app:layout_constraintStart_toStartOf="#+id/button6"
app:layout_constraintTop_toBottomOf="#+id/button6" />
<TextView
android:id="#+id/textView13"
style="#style/ModuleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="#string/modifier_sets"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView12" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/textView13">
</android.support.v7.widget.RecyclerView>
<TextView
android:id="#+id/textView14"
style="#style/ModuleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="#string/taxes"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/recyclerView" />
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView2"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/textView14" />
<TextView
android:id="#+id/textView17"
style="#style/ModuleTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="#string/select_kitchen_location"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/recyclerView2" />
<Spinner
android:id="#+id/spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:padding="8dp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/textView17" />
<CheckBox
android:id="#+id/checkBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="#string/available"
android:textColor="#color/black"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/spinner" />
<EditText
style="#style/CustomEditText"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:textColor="#color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toBottomOf="#+id/checkBox" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
This is the include layout.
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgDlgHeaderAction"
android:layout_width="90dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="#+id/lblDlgHeaderTitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_add_24dp" />
<Button
android:id="#+id/btnDlgHeaderSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/border_bg_pressed"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="#string/save"
android:textColor="#color/white"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/lblDlgHeaderTitle"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:text="TextView"
android:textColor="#color/black"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="#+id/btnDlgHeaderSave"
app:layout_constraintEnd_toStartOf="#+id/btnDlgHeaderSave"
app:layout_constraintStart_toEndOf="#id/imgDlgHeaderAction"
app:layout_constraintTop_toTopOf="#+id/btnDlgHeaderSave" />
</android.support.constraint.ConstraintLayout>
In the layout editor, it looks fine. But when I compile my code, the ScrollView is clipping through the include without that much marginTop. I might file an issue if this is a bug.
From the suggestions below, I tried to change ScrollView to a NestedScrollView. As I have guessed, it still didn't work.
I also want to emphasized that my question is not about the RecyclerViews not being able to scroll, because I know that would happen, but about the clipping of the ScrollView through the include layout.
Change your include layout constraint like below
Remove bottom constarint and used NestedScrollView in main layout instead of ScrollView
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgDlgHeaderAction"
android:layout_width="90dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="#+id/btnDlgHeaderSave"
app:layout_constraintEnd_toStartOf="#+id/lblDlgHeaderTitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/btnDlgHeaderSave"
app:srcCompat="#drawable/ic_email" />
<Button
android:id="#+id/btnDlgHeaderSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#color/bg_toolbar"
android:gravity="center"
android:paddingStart="32dp"
android:paddingTop="16dp"
android:paddingEnd="32dp"
android:paddingBottom="16dp"
android:text="#string/save"
android:textColor="#android:color/white"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/lblDlgHeaderTitle"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/lblDlgHeaderTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="TextView"
android:textColor="#android:color/black"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="#+id/btnDlgHeaderSave"
app:layout_constraintEnd_toStartOf="#+id/btnDlgHeaderSave"
app:layout_constraintStart_toEndOf="#+id/imgDlgHeaderAction"
app:layout_constraintTop_toTopOf="#+id/btnDlgHeaderSave" />
</androidx.constraintlayout.widget.ConstraintLayout>
Main layout
<androidx.constraintlayout.widget.ConstraintLayout 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:background="#f5f5f5">
<include
android:id="#+id/includeItem"
layout="#layout/test_include"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.core.widget.NestedScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/includeItem">
<!.. Remining one as it is>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
I'm having a considerable issue that I haven't encountered before. I did what I normally do working with constraints. Not all of my fields will fit on the screen. It shows up fine running on an external tablet. Below is my activitymain. I've also ran it in linear and relative layout. I can Any help would be appreciated.
<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/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorBlack"
tools:context=".MainActivity">
<Spinner
android:id="#+id/spCompany"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="468dp"
android:background="#color/colorWhite"
android:gravity="center"
android:spinnerMode="dropdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rnumberText" />
<TextView
android:id="#+id/densityText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:text=""
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#id/strainerLabel"
app:layout_constraintTop_toBottomOf="#+id/spCompany" />
<TextView
android:id="#+id/strainerLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/strainer"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/strainerText"
app:layout_constraintTop_toBottomOf="#+id/spCompany" />
<TextView
android:id="#+id/strainerText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text=""
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/spRatio"
app:layout_constraintTop_toBottomOf="#+id/strainerLabel" />
<Spinner
android:id="#+id/spRatio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:spinnerMode="dropdown"
app:layout_constraintBottom_toTopOf="#+id/enterweightLabel"
app:layout_constraintTop_toBottomOf="#+id/strainerText" />
<TextView
android:id="#+id/rnumberText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:text=""
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#+id/spCompany"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread_inside" />
<TextView
android:id="#+id/catdensityText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:text=""
app:layout_constraintBottom_toBottomOf="#+id/spRatio"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spRatio" />
<TextView
android:id="#+id/enterweightLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/enter_weight"
android:textAlignment="center"
android:textStyle="bold"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/weightInput"
app:layout_constraintTop_toBottomOf="#+id/spRatio" />
<EditText
android:id="#+id/weightInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:autofillHints="Enter Weight"
android:background="#color/colorWhite"
android:clickable="true"
android:ems="10"
android:focusable="true"
android:gravity="center"
android:imeOptions="actionDone"
android:importantForAutofill="yes"
android:inputType="numberDecimal"
android:singleLine="true"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalcatLabel"
app:layout_constraintTop_toBottomOf="#+id/enterweightLabel"
tools:targetApi="o" />
<TextView
android:id="#+id/totalcatLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/total_catalyst"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalcatText"
app:layout_constraintTop_toBottomOf="#+id/weightInput" />
<TextView
android:id="#+id/totalcatText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:clickable="false"
android:gravity="center"
android:text=""
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalweightLabel"
app:layout_constraintTop_toBottomOf="#+id/totalcatLabel" />
<TextView
android:id="#+id/totalweightLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/total_weight"
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalweightText"
app:layout_constraintTop_toBottomOf="#+id/totalcatText" />
<TextView
android:id="#+id/totalweightText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center_horizontal|center_vertical"
android:text=""
android:textSize="60sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/calcButton"
app:layout_constraintTop_toBottomOf="#+id/totalweightLabel" />
<Button
android:id="#+id/calcButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:clickable="true"
android:focusable="true"
android:text="#string/calculate"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/clearButton"
app:layout_constraintTop_toBottomOf="#+id/totalweightText" />
<Button
android:id="#+id/clearButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:clickable="true"
android:focusable="true"
android:text="#string/Clear"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="#+id/calcButton" />
</android.support.constraint.ConstraintLayout>
You can put your ConstraintLayout inside a ScrollView
Yeah, your content takes more room than the available then your view overflows the device. Using a ScrollView will solve you problem with short screens.
This is how looks like:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/root">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorBlack"
tools:context=".MainActivity">
<Spinner
android:id="#+id/spCompany"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="468dp"
android:background="#color/colorWhite"
android:gravity="center"
android:spinnerMode="dropdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rnumberText" />
<TextView
android:id="#+id/densityText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:text=""
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#id/strainerLabel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spCompany" />
<TextView
android:id="#+id/strainerLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/strainer"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/strainerText"
app:layout_constraintTop_toBottomOf="#+id/spCompany" />
<TextView
android:id="#+id/strainerText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text=""
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/spRatio"
app:layout_constraintTop_toBottomOf="#+id/strainerLabel" />
<Spinner
android:id="#+id/spRatio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:spinnerMode="dropdown"
app:layout_constraintBottom_toTopOf="#+id/enterweightLabel"
app:layout_constraintTop_toBottomOf="#+id/strainerText" />
<TextView
android:id="#+id/rnumberText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:text=""
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#+id/spCompany"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread_inside" />
<TextView
android:id="#+id/catdensityText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:text=""
app:layout_constraintBottom_toBottomOf="#+id/spRatio"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spRatio" />
<TextView
android:id="#+id/enterweightLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/enter_weight"
android:textAlignment="center"
android:textStyle="bold"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/weightInput"
app:layout_constraintTop_toBottomOf="#+id/spRatio" />
<EditText
android:id="#+id/weightInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:autofillHints="Enter Weight"
android:background="#color/colorWhite"
android:clickable="true"
android:ems="10"
android:focusable="true"
android:gravity="center"
android:imeOptions="actionDone"
android:importantForAutofill="yes"
android:inputType="numberDecimal"
android:singleLine="true"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalcatLabel"
app:layout_constraintTop_toBottomOf="#+id/enterweightLabel"
tools:targetApi="o" />
<TextView
android:id="#+id/totalcatLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/total_catalyst"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalcatText"
app:layout_constraintTop_toBottomOf="#+id/weightInput" />
<TextView
android:id="#+id/totalcatText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:background="#color/colorWhite"
android:clickable="false"
android:gravity="center"
android:text=""
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalweightLabel"
app:layout_constraintTop_toBottomOf="#+id/totalcatLabel" />
<TextView
android:id="#+id/totalweightLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center"
android:text="#string/total_weight"
android:textSize="30sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/totalweightText"
app:layout_constraintTop_toBottomOf="#+id/totalcatText" />
<TextView
android:id="#+id/totalweightText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:gravity="center_horizontal|center_vertical"
android:text=""
android:textSize="60sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/calcButton"
app:layout_constraintTop_toBottomOf="#+id/totalweightLabel" />
<Button
android:id="#+id/calcButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="#color/colorWhite"
android:clickable="true"
android:focusable="true"
android:text="#string/calculate"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/clearButton"
app:layout_constraintTop_toBottomOf="#+id/totalweightText" />
<Button
android:id="#+id/clearButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
android:clickable="true"
android:focusable="true"
android:text="#string/Clear"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="#+id/calcButton" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
I have a XML layout as follows:
<?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:card_view="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/accounts_details_page_background_color">
<android.support.v7.widget.CardView
android:id="#+id/overview_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp"
card_view:ignore="PrivateResource">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
<TextView
android:id="#+id/fragment_compliance_details_overview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/compliance_details_fragment_overview"
android:textColor="#color/compliance_overview_title_color"
android:textSize="#dimen/text_size_small"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/policy_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:textColor="#color/black"
android:textSize="#dimen/text_size_large"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/fragment_compliance_details_overview" />
<TextView
android:id="#+id/last_check_time_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/policy_name" />
<View
android:id="#+id/horizontal_line_compliance"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?android:attr/listDivider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time_only" />
<TextView
android:id="#+id/compliance_policy_status_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/horizontal_line_compliance" />
<TextView
android:id="#+id/last_check_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/last_compliance_check_time"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/compliance_policy_status_explanation" />
<TextView
android:id="#+id/compliance_user_action_advice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/compliance_user_advice"
android:textSize="#dimen/text_size_small"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/details_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="#color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/overview_cardview"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="#+id/policy_details_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/policy_details_title"
android:textColor="#color/compliance_overview_title_color"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone" />
<ListView
android:id="#+id/compliance_rules_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
When the ListView has more than 3-4 rows the page does not scroll. The ListView does not scroll either.
I tried wrapping the whole thing in a NestedScrollView but that just gets the ListView scrolling and not even entirely.
I want the entire page to scroll and end scrolling when the ListView ends. Any ideas would help.
You don't need constraint layout for what you are doing.
Read about view weights.
Try this. (replace androix.* for your components)
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="#+id/overview_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#color/white"
app:cardUseCompatPadding="true"
app:contentPadding="4dp"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/fragment_compliance_details_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/policy_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
android:textColor="#color/black"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/fragment_compliance_details_overview" />
<TextView
android:id="#+id/last_check_time_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/policy_name" />
<View
android:id="#+id/horizontal_line_compliance"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?android:attr/listDivider" />
<TextView
android:id="#+id/compliance_policy_status_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/horizontal_line_compliance" />
<TextView
android:id="#+id/last_check_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/compliance_policy_status_explanation" />
<TextView
android:id="#+id/compliance_user_action_advice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/has_accepted_your_invitation_to_fynd"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/details_cardview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#color/white"
app:cardUseCompatPadding="true"
app:contentPadding="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/overview_cardview"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/policy_details_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="test"
android:textSize="14sp"
android:textStyle="bold" />
<ListView
android:id="#+id/compliance_rules_listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
I have a ScrollView which has a ConstraintLayout. I am trying to load a content, but when the content is too large, I start loosing the footer. This works fine when I have short or medium content, but only happens with very very large content.
This is the problem
This is the structure of my layout
I am doing the inspection with the Layout inspector and this is the result
This is the result of the Layout Inspector
This is the structure of the layout in the Inspector
Any Idea?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/id_scv_article_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible"
tools:context=".ui.activities.contents.ArticleDetailActivity">
<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/id_cnt_article_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<android.support.v7.widget.Toolbar
android:id="#+id/id_article_detail_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:clickable="true"
android:focusable="true"
android:minHeight="?attr/actionBarSize"
android:textAlignment="center"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:titleTextAppearance="#style/TitleBarTextAppearance" />
<ImageView
android:id="#+id/id_img_article_det"
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_article_detail_toolbar"
app:srcCompat="#drawable/no_image" />
<TextView
android:id="#+id/id_txt_title_article_det"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/info_not_title_defined"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_img_article_det" />
<TextView
android:id="#+id/id_txt_summary_article_det"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_medium"
android:text="#string/info_not_short_text_defined"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_txt_title_article_det" />
<LinearLayout
android:id="#+id/ln_text_content_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="#drawable/linear_layout_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_txt_summary_article_det">
<TextView
android:id="#+id/id_txt_text_article_det"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:fontFamily="#font/roboto_regular"
android:text="#string/textoooo" />
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:id="#+id/id_cnt_gallery_article_det"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/ln_text_content_article">
<TextView
android:id="#+id/id_txt_title_gallery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/title_gallery"
android:textColor="#color/colorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.RecyclerView
android:id="#+id/id_recycler_view_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_txt_title_gallery" />
<Button
android:id="#+id/button3"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginEnd="32dp"
android:layout_marginTop="8dp"
android:background="#color/colorLines"
android:backgroundTint="#color/colorLines"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_recycler_view_gallery" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="#+id/id_cnt_calendar_article_det"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_cnt_gallery_article_det">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/id_calendar_article"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="#id/id_calendar_article"
layout="#layout/recycler_view_calendar">
</include>
</android.support.constraint.ConstraintLayout>
<Button
android:id="#+id/button4"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginEnd="32dp"
android:layout_marginTop="8dp"
android:background="#color/colorLines"
android:backgroundTint="#color/colorLines"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_calendar_article" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="#+id/id_cnt_resources_article_det"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_cnt_calendar_article_det">
<LinearLayout
android:id="#+id/ln_document_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent">
<ImageView
android:id="#+id/imageView4"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="2"
app:srcCompat="#drawable/pdf_icon" />
<TextView
android:id="#+id/id_name_pdf_article"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:ellipsize="end"
android:fontFamily="#font/roboto_regular"
android:maxLines="2"
android:text="#string/info_not_title_defined" />
<ImageView
android:id="#+id/id_img_download_pdf_article"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="2"
app:srcCompat="#drawable/download_icon" />
</LinearLayout>
<View
android:id="#+id/id_ln_document_separator"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="#DEDEDE"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/ln_document_article" />
<LinearLayout
android:id="#+id/ln_link_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:weightSum="10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/id_ln_document_separator">
<TextView
android:id="#+id/id_txt_link_article"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_weight="5"
android:fontFamily="#font/roboto_medium"
android:maxLines="2"
android:text="#string/info_not_title_defined" />
<TextView
android:id="#+id/id_txt_copy_link_article"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:fontFamily="#font/roboto_regular"
android:text="#string/lbl_copy_link"
android:textAlignment="textEnd"
android:textColor="?android:attr/colorEdgeEffect" />
<TextView
android:id="#+id/id_txt_go_link_article"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:fontFamily="#font/roboto_regular"
android:text="#string/lbl_go"
android:textAlignment="center"
android:textColor="?android:attr/colorEdgeEffect" />
</LinearLayout>
<View
android:id="#+id/id_ln_link_separator"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="#DEDEDE"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/ln_link_article" />
<LinearLayout
android:id="#+id/ln_image_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:weightSum="10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/id_ln_link_separator">
<ImageView
android:id="#+id/id_img_img_article"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_margin="8dp"
android:layout_weight="4"
android:scaleType="centerCrop"
app:srcCompat="#drawable/no_image" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="6"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/id_txt_name_img_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_regular"
android:text="#string/info_not_title_defined" />
<TextView
android:id="#+id/id_txt_download_img_article"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_regular"
android:text="#string/lbl_download"
android:textColor="?android:attr/colorEdgeEffect" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<View
android:id="#+id/view1"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="#color/colorLines"
app:layout_constraintStart_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_cnt_resources_article_det" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/lbl_author"
android:textColor="#color/colorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view1" />
<TextView
android:id="#+id/id_txt_author_article"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="80dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_regular"
android:text="#string/info_not_art_author_defined"
app:layout_constraintStart_toStartOf="#+id/textView13"
app:layout_constraintTop_toBottomOf="#+id/view1" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/lbl_publication_date"
android:textColor="#color/colorSecondary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
<TextView
android:id="#+id/id_txt_publication_date_article"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_regular"
android:text="#string/info_not_art_defined"
app:layout_constraintStart_toStartOf="#+id/id_txt_author_article"
app:layout_constraintTop_toBottomOf="#+id/id_txt_author_article" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:fontFamily="#font/roboto_bold"
android:text="#string/lbl_last_modification_date"
android:textColor="#color/colorSecondary"
app:layout_constraintStart_toEndOf="#+id/id_txt_publication_date_article"
app:layout_constraintTop_toBottomOf="#+id/id_txt_author_article" />
<TextView
android:id="#+id/id_txt_last_update_date_article"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="#font/roboto_regular"
android:text="#string/info_not_art_defined"
app:layout_constraintStart_toEndOf="#+id/textView16"
app:layout_constraintTop_toTopOf="#+id/textView16" />
<Button
android:id="#+id/button6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginTop="32dp"
android:background="#android:color/white"
android:backgroundTint="#android:color/white"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
</android.support.constraint.ConstraintLayout>
As I could not find the real problem, I decided to rewrite the layout again. I removed some of the elements that were not necessary like the intern ConstraintsLayouts and I wrapped the content in a layout, instead a scrollview like #E.Abdel suggested.
Thank you!