ConstraintLayout doesn't match parent completely - android

I have a ScrollView that wraps a ConstraintLayout, the issue is that despite the ScrollView does match completely the screen, the Constraint doesn't. I have settled both to match_parent, but the ConstraintLayout doesn't fill around a 20% on the bottom as you can see in the image, the blue line of the bottom is the max height of my ConstraintLayout , I have read many articles but haven't been able to find an answer, I don't know if this is related to data-binding. Here my code `
<data>
<variable
name="bindingViewModel"
type="com.example.workoutstopwatch.MainActivityViewModel" />
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:layout_marginLeft="10sp"
android:layout_marginTop="10sp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:text="#string/set_your_work_out_time"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/edit_work_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:layout_weight="3"
android:hint="#string/_00"
android:inputType="number"
android:maxLength="2"
android:text="#={bindingViewModel.workOutTime}"
android:textSize="80sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView3" />
<Button
android:id="#+id/up_arrow_work"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="top"
android:layout_marginStart="180dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="#drawable/arrow_left_foreground"
android:onClick="setDurationType"
android:rotation="90"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/edit_work_text"
app:layout_constraintTop_toBottomOf="#+id/textView3" />
<TextView
android:id="#+id/work_min_or_secs_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/up_arrow_work"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="52dp"
android:hint="Secs"
android:text="#{bindingViewModel.workMinOrSecsText}"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="#+id/down_arrow_work"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.739"
app:layout_constraintStart_toEndOf="#+id/edit_work_text"
app:layout_constraintTop_toBottomOf="#+id/textView3"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="#+id/down_arrow_work"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_gravity="top"
android:layout_marginStart="180dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="#drawable/arrow_left_foreground"
android:onClick="setDurationType"
android:rotation="90"
android:rotationX="189"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.983"
app:layout_constraintStart_toEndOf="#+id/edit_work_text"
app:layout_constraintTop_toBottomOf="#+id/up_arrow_work" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="197dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="163dp"
android:text="#string/set_your_rest_time"
android:textSize="30sp"
app:layout_constraintBottom_toTopOf="#+id/textView5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.304"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/edit_rest_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="12dp"
android:layout_weight="3"
android:hint="#string/_00"
android:inputType="number"
android:maxLength="2"
android:text="#={bindingViewModel.restTime}"
android:textSize="80sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView4" />
<Button
android:id="#+id/up_arrow_rest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="top"
android:layout_marginStart="180dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="#drawable/arrow_left_foreground"
android:onClick="setDurationType"
android:rotation="90"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/edit_rest_text"
app:layout_constraintTop_toBottomOf="#+id/textView4" />
<TextView
android:id="#+id/rest_min_or_secs_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/up_arrow_work"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="52dp"
android:hint="Secs"
android:text="#{bindingViewModel.restMinOrSecsText}"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="#+id/down_arrow_rest"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.739"
app:layout_constraintStart_toEndOf="#+id/edit_rest_text"
app:layout_constraintTop_toBottomOf="#+id/textView4"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="#+id/down_arrow_rest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_gravity="top"
android:layout_marginStart="180dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:background="#drawable/arrow_left_foreground"
android:onClick="setDurationType"
android:rotation="90"
android:rotationX="189"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.983"
app:layout_constraintStart_toEndOf="#+id/edit_rest_text"
app:layout_constraintTop_toBottomOf="#+id/up_arrow_rest" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="168dp"
android:text="#string/set_your_number_of_reps"
android:textSize="30sp"
app:layout_constraintBottom_toTopOf="#+id/start_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.611"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView4" />
<EditText
android:id="#+id/edit_reps_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="16dp"
android:layout_weight="3"
android:hint="#string/_00"
android:inputType="number"
android:maxLength="2"
android:text="#={bindingViewModel.numberOfReps}"
android:textSize="80sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView5" />
<TextView
android:id="#+id/start_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:gravity="center"
android:onClick="startTraining"
android:text="START!"
android:textColor="#FF1800"
android:textSize="60sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
`

Related

constraint layout doesn't look the same in different screen

I want my layout to support all screen sizes,I'm using constraint layout,when i run it on different emulators it doesn't look the same,I'm using dp for sizes and margins,note this app have 12 screens so i can't make layout for every screen size, i tried setting the width of first two cardviews to wrap_content but it seems its not working
[![small screen][1]][1]
<androidx.cardview.widget.CardView
android:id="#+id/id_card_timeView"
android:layout_width="326dp"
android:layout_height="72dp"
android:layout_marginStart="18dp"
android:layout_marginTop="11dp"
android:layout_marginEnd="16dp"
app:cardBackgroundColor="#ff1972a0"
app:cardCornerRadius="39dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/cardView8">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="149dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="145dp"
android:layout_marginBottom="3dp"
android:text="10"
android:textColor="#fff"
android:textSize="27sp" />
<TextView
android:layout_width="32dp"
android:layout_height="58dp"
android:layout_marginStart="90dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="204dp"
android:layout_marginBottom="3dp"
android:text="09"
android:textColor="#fff"
android:textSize="27sp" />
<TextView
android:layout_width="159dp"
android:layout_height="26dp"
android:layout_marginStart="92dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="94dp"
android:layout_marginBottom="46dp"
android:maxLines="1"
android:text="time until next session"
android:textAllCaps="true"
android:textColor="#fff"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="203dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="91dp"
android:layout_marginBottom="3dp"
android:text="23"
android:textColor="#fff"
android:textSize="27sp" />
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/textView2"
android:layout_width="62dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="278dp"
android:text="OVERVIEW"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_card_timeView" />
<View
android:id="#+id/view7"
android:layout_width="327dp"
android:layout_height="1dp"
android:layout_marginStart="17dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="16dp"
android:background="#707070ff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
<View
android:id="#+id/view6"
android:layout_width="327dp"
android:layout_height="1dp"
android:layout_marginStart="17dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="16dp"
android:background="#707070ff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2" />
<View
android:id="#+id/view8"
android:layout_width="327dp"
android:layout_height="1dp"
android:layout_marginStart="17dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="16dp"
android:background="#707070ff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_reviews" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginTop="27dp"
android:layout_marginEnd="296dp"
android:text="ORDERS"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_card_pagView" />
<androidx.cardview.widget.CardView
android:id="#+id/id_card_orderSmall"
android:layout_width="wrap_content"
android:layout_height="133dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_card_earning">
<ImageView
android:id="#+id/imageView9"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="12dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/order_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="67dp"
android:layout_marginEnd="99dp"
android:layout_marginBottom="40dp"
android:text="ORDER"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
<TextView
android:id="#+id/id_order_txt"
android:layout_width="50dp"
android:layout_height="49dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="81dp"
android:layout_marginEnd="104dp"
android:layout_marginBottom="3dp"
android:text="44"
android:textColor="#ff565659"
android:textSize="30sp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/id_card_pagView"
android:layout_width="wrap_content"
android:layout_height="133dp"
android:layout_marginStart="20dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="#drawable/card_cut"
app:layout_constraintEnd_toStartOf="#+id/id_card_orderSmall"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_sale_card">
<ImageView
android:id="#+id/imageView6"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="25dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/pageview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="67dp"
android:layout_marginEnd="75dp"
android:layout_marginBottom="40dp"
android:text="PAGE VIEW"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
<TextView
android:id="#+id/id_pageView_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="20dp"
android:layout_marginTop="81dp"
android:layout_marginEnd="85dp"
android:layout_marginBottom="3dp"
android:text="99k"
android:textColor="#ff565659"
android:textSize="30sp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/id_sale_card"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_marginStart="18dp"
android:layout_marginTop="#dimen/_19sdp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toStartOf="#+id/id_card_earning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view6">
<ImageView
android:id="#+id/imageView4"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/sale" />
<TextView
android:id="#+id/id_sale_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="19dp"
android:layout_marginTop="34dp"
android:layout_marginEnd="98dp"
android:layout_marginBottom="11dp"
android:text="$0.00"
android:textColor="#ff565659" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="109dp"
android:layout_marginBottom="31dp"
android:text="Sale"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/id_card_earning"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:layout_marginStart="16dp"
android:layout_marginTop="#dimen/_19sdp"
android:layout_marginEnd="18dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/id_sale_card"
app:layout_constraintTop_toBottomOf="#+id/view6">
<ImageView
android:id="#+id/imageView8"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="15dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/earning" />
<TextView
android:id="#+id/id_earning_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="19dp"
android:layout_marginTop="34dp"
android:layout_marginEnd="98dp"
android:layout_marginBottom="11dp"
android:text="$0.00"
android:textColor="#ff565659" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="15dp"
android:maxLines="1"
android:text="Earning"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/id_reviews"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="19dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="289dp"
android:layout_marginBottom="10dp"
android:text="REVIEWS"
android:textAllCaps="true"
app:layout_constraintBottom_toTopOf="#id/id_card_reviewBig"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/id_card_orderBig" />
<androidx.cardview.widget.CardView
android:id="#+id/id_card_orderBig"
android:layout_width="326dp"
android:layout_height="253dp"
android:layout_marginStart="18dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.549"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view7">
<TextView
android:id="#+id/id_cardTxt_total"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="Total"
android:textColor="#ff565659" />
<TextView
android:id="#+id/completed_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="53dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="174dp"
android:text="Completed"
android:textColor="#ff1e9b37" />
<TextView
android:id="#+id/pending_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="85dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="110dp"
android:text="Pending"
android:textColor="#ff949494" />
<TextView
android:id="#+id/processing_txt"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="117dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="Processing"
android:textColor="#ff6c6ca7" />
<TextView
android:id="#+id/cancelled_txt"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="149dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="Cancelled"
android:textColor="#fff33d3d" />
<TextView
android:id="#+id/refunded_txt"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="181dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="Refunded"
android:textColor="#ffd6d61a" />
<TextView
android:id="#+id/onHold_txt"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="213dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="On Hold"
android:textColor="#ffbf7f0f" />
<TextView
android:id="#+id/id_txt_total_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#ff565659" />
<TextView
android:id="#+id/id_txt_completed_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="53dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#ff1e9b37" />
<TextView
android:id="#+id/id_txt_pending_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="85dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#ff949494" />
<TextView
android:id="#+id/id_txt_processing_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="117dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#ff6c6ca7" />
<TextView
android:id="#+id/id_txt_cancelled_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="149dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#fff33d3d" />
<TextView
android:id="#+id/id_txt_refunded_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="181dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="206dp"
android:text="100"
android:textColor="#ffd6d61a" />
<TextView
android:id="#+id/id_txt_onHold_bigCard"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="283dp"
android:layout_marginTop="213dp"
android:layout_marginEnd="10dp"
android:text="100"
android:textColor="#ffbf7f0f" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/id_card_reviewBig"
android:layout_width="326dp"
android:layout_height="173dp"
android:layout_marginStart="18dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="13dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.549"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view8">
<TextView
android:id="#+id/id_cardTxt_totalReviews"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="205dp"
android:text="Total"
android:textColor="#ff565659" />
<TextView
android:id="#+id/id_cardTxt_liveReviews"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="53dp"
android:layout_marginEnd="150dp"
android:layout_marginBottom="174dp"
android:text="Live"
android:textColor="#ff565659" />
</androidx.cardview.widget.CardView>
[1]: https://i.stack.imgur.com/WsrEo.png
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff5f5f5">
<androidx.cardview.widget.CardView
android:id="#+id/id_sale_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="19dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toStartOf="#+id/id_card_earning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view6">
<androidx.cardview.widget.CardView
android:id="#+id/id_card_earning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="189dp"
android:layout_marginTop="19dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view6">
Keep UI like this and use below libs
Intuit SSP
Intuit SDP
It's true that #Venky answered, but in my answer, I want to explain why your layout is not looking the same on all devices:
In Android, you need to consider the number of different screen sizes when developing an android application.
Different phones got different screen size, in your layout you are using fixed size on your view (fixed size is android:layout_width="155dp" for example) and the result is that what may look good on one screen (your android studio preview screen)but will not look good on another screen (your actual phone).
A simple solution will be to make the width of your views as match_parent (so it will spread all over the screen) and the height of your views as wrap_content
something like this:
<androidx.cardview.widget.CardView
android:id="#+id/id_sale_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toStartOf="#+id/id_card_earning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view6">
<androidx.cardview.widget.CardView
android:id="#+id/id_card_earning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view6">
Edit:
This is my new layout using Guidelines:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="#+id/id_card_timeView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
app:cardBackgroundColor="#ff1972a0"
app:cardCornerRadius="39dp"
app:layout_constraintBottom_toTopOf="#+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="149dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="145dp"
android:layout_marginBottom="3dp"
android:text="10"
android:textColor="#fff"
android:textSize="27sp" />
<TextView
android:layout_width="32dp"
android:layout_height="58dp"
android:layout_marginStart="90dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="204dp"
android:layout_marginBottom="3dp"
android:text="09"
android:textColor="#fff"
android:textSize="27sp" />
<TextView
android:layout_width="159dp"
android:layout_height="26dp"
android:layout_marginStart="92dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="94dp"
android:layout_marginBottom="46dp"
android:maxLines="1"
android:text="time until next session"
android:textAllCaps="true"
android:textColor="#fff"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="203dp"
android:layout_marginTop="22dp"
android:layout_marginEnd="91dp"
android:layout_marginBottom="3dp"
android:text="23"
android:textColor="#fff"
android:textSize="27sp" />
</android.support.v7.widget.CardView>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OVERVIEW"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="#+id/id_sale_card"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/id_card_timeView" />
<View
android:id="#+id/view7"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="#707070ff"
app:layout_constraintBottom_toTopOf="#+id/id_card_orderBig"
app:layout_constraintEnd_toEndOf="#+id/id_card_timeView"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
<View
android:id="#+id/view6"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="#707070ff"
app:layout_constraintBottom_toTopOf="#+id/id_card_pagView"
app:layout_constraintEnd_toEndOf="#+id/id_card_timeView"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/id_sale_card" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ORDERS"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="#+id/view7"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/id_card_pagView" />
<android.support.v7.widget.CardView
android:id="#+id/id_card_orderSmall"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="#+id/view7"
app:layout_constraintEnd_toEndOf="#+id/id_card_timeView"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/id_card_pagView"
app:layout_constraintTop_toBottomOf="#+id/id_card_earning">
<ImageView
android:id="#+id/imageView9"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="12dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/order_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="67dp"
android:layout_marginEnd="99dp"
android:layout_marginBottom="40dp"
android:text="ORDER"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
<TextView
android:id="#+id/id_order_txt"
android:layout_width="50dp"
android:layout_height="49dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="81dp"
android:layout_marginEnd="104dp"
android:layout_marginBottom="3dp"
android:text="44"
android:textColor="#ff565659"
android:textSize="30sp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/id_card_pagView"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#drawable/card_cut"
app:layout_constraintBottom_toTopOf="#+id/textView13"
app:layout_constraintEnd_toStartOf="#+id/id_card_orderSmall"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/view6">
<ImageView
android:id="#+id/imageView6"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="25dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/pageview" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="16dp"
android:layout_marginTop="67dp"
android:layout_marginEnd="75dp"
android:layout_marginBottom="40dp"
android:text="PAGE VIEW"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
<TextView
android:id="#+id/id_pageView_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="20dp"
android:layout_marginTop="81dp"
android:layout_marginEnd="85dp"
android:layout_marginBottom="3dp"
android:text="99k"
android:textColor="#ff565659"
android:textSize="30sp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/id_sale_card"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="#+id/view6"
app:layout_constraintEnd_toStartOf="#+id/id_card_earning"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/textView2">
<ImageView
android:id="#+id/imageView4"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/sale" />
<TextView
android:id="#+id/id_sale_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="19dp"
android:layout_marginTop="34dp"
android:layout_marginEnd="98dp"
android:layout_marginBottom="11dp"
android:text="$0.00"
android:textColor="#ff565659" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="109dp"
android:layout_marginBottom="31dp"
android:text="Sale"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/id_card_earning"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="#+id/id_card_orderSmall"
app:layout_constraintEnd_toEndOf="#+id/id_card_timeView"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/id_sale_card"
app:layout_constraintTop_toBottomOf="#+id/id_card_timeView">
<ImageView
android:id="#+id/imageView8"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="101dp"
android:layout_marginTop="15dp"
android:background="#drawable/card_images"
android:scaleType="center"
android:src="#drawable/earning" />
<TextView
android:id="#+id/id_earning_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="19dp"
android:layout_marginTop="34dp"
android:layout_marginEnd="98dp"
android:layout_marginBottom="11dp"
android:text="$0.00"
android:textColor="#ff565659" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="18dp"
android:layout_marginTop="15dp"
android:maxLines="1"
android:text="Earning"
android:textAllCaps="true"
android:textColor="#ff565659"
android:textSize="12sp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/id_card_orderBig"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/id_card_timeView"
app:layout_constraintStart_toStartOf="#+id/id_card_timeView"
app:layout_constraintTop_toBottomOf="#+id/view7">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/completed_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="Completed"
android:textColor="#ff1e9b37"
app:layout_constraintBottom_toTopOf="#+id/processing_txt"
app:layout_constraintStart_toStartOf="#+id/onHold_txt"
app:layout_constraintTop_toBottomOf="#+id/onHold_txt" />
<TextView
android:id="#+id/pending_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="Pending"
android:textColor="#ff949494"
app:layout_constraintBottom_toTopOf="#+id/refunded_txt"
app:layout_constraintStart_toStartOf="#+id/onHold_txt"
app:layout_constraintTop_toBottomOf="#+id/cancelled_txt" />
<TextView
android:id="#+id/processing_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="Processing"
android:textColor="#ff6c6ca7"
app:layout_constraintBottom_toTopOf="#+id/cancelled_txt"
app:layout_constraintStart_toStartOf="#+id/onHold_txt"
app:layout_constraintTop_toBottomOf="#+id/completed_txt" />
<TextView
android:id="#+id/cancelled_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="Cancelled"
android:textColor="#fff33d3d"
app:layout_constraintBottom_toTopOf="#+id/pending_txt"
app:layout_constraintStart_toStartOf="#+id/onHold_txt"
app:layout_constraintTop_toBottomOf="#+id/processing_txt" />
<TextView
android:id="#+id/refunded_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="Refunded"
android:textColor="#ffd6d61a"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="#+id/onHold_txt"
app:layout_constraintTop_toBottomOf="#+id/pending_txt" />
<TextView
android:id="#+id/onHold_txt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="On Hold"
android:textColor="#ffbf7f0f"
app:layout_constraintBottom_toTopOf="#+id/completed_txt"
app:layout_constraintEnd_toStartOf="#+id/guideline7"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/id_txt_total_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="100"
android:textColor="#ff565659"
app:layout_constraintBottom_toTopOf="#+id/id_txt_processing_bigCard"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/guideline7"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/id_txt_completed_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#ff1e9b37"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/id_txt_pending_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_pending_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_pending_bigCard" />
<TextView
android:id="#+id/id_txt_pending_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#ff949494"
app:layout_constraintBottom_toTopOf="#+id/id_txt_completed_bigCard"
app:layout_constraintEnd_toEndOf="#+id/id_txt_refunded_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_refunded_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_refunded_bigCard" />
<TextView
android:id="#+id/id_txt_processing_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#ff6c6ca7"
app:layout_constraintBottom_toTopOf="#+id/id_txt_cancelled_bigCard"
app:layout_constraintEnd_toEndOf="#+id/id_txt_total_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_total_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_total_bigCard" />
<TextView
android:id="#+id/id_txt_cancelled_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#fff33d3d"
app:layout_constraintBottom_toTopOf="#+id/id_txt_onHold_bigCard"
app:layout_constraintEnd_toEndOf="#+id/id_txt_total_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_total_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_processing_bigCard" />
<TextView
android:id="#+id/id_txt_refunded_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#ffd6d61a"
app:layout_constraintBottom_toTopOf="#+id/id_txt_pending_bigCard"
app:layout_constraintEnd_toEndOf="#+id/id_txt_total_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_total_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_onHold_bigCard" />
<TextView
android:id="#+id/id_txt_onHold_bigCard"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="100"
android:textColor="#ffbf7f0f"
app:layout_constraintBottom_toTopOf="#+id/id_txt_refunded_bigCard"
app:layout_constraintEnd_toEndOf="#+id/id_txt_total_bigCard"
app:layout_constraintStart_toStartOf="#+id/id_txt_total_bigCard"
app:layout_constraintTop_toBottomOf="#+id/id_txt_cancelled_bigCard" />
<android.support.constraint.Guideline
android:id="#+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="163dp"
app:layout_constraintGuide_percent=".56" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
He is how it will look:

Tiny gap between ImageView and RelativeLayout

I have a little triangle indicating whether the user is in the registration or login screen, but there is a tiny gap between the triangle image and the RelativeLayout view it is under
That is as high as the triangle will go, and I am not sure how to raise it just 1 more pixel to get rid of that annoying gap. Here is my XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorLightTan"
tools:context=".LoginActivity">
<RelativeLayout
android:id="#+id/relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="58dp"
android:background="#color/colorCoral"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/relativeLayout"
app:layout_constraintVertical_bias="0.0">
<TextView
android:id="#+id/logintextBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginStart="49dp"
android:layout_marginLeft="49dp"
android:layout_weight="1"
android:font="#font/americancaptain"
android:text="Login"
android:textColor="#color/colorBackground"
android:textSize="26dp"
app:fontFamily="sans-serif-condensed" />
<TextView
android:id="#+id/logintextBar3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginStart="260dp"
android:layout_marginLeft="260dp"
android:layout_weight="1"
android:font="#font/americancaptain"
android:text="Register"
android:textColor="#color/colorBackground"
android:textSize="26dp"
app:fontFamily="sans-serif-condensed" />
<Button
android:id="#+id/registerButtonLogin"
android:layout_width="150dp"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:padding="0dp"
android:text=""
android:background="#android:color/transparent"
/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="fill_parent"
android:layout_height="79dp"
android:background="#color/colorBackground"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="53dp"
android:layout_marginLeft="53dp"
android:layout_marginBottom="-33dp"
android:layout_weight="1"
android:paddingBottom="0dp"
app:srcCompat="#drawable/halfhalf" />
</RelativeLayout>
<ImageView
android:id="#+id/imageView4"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="-20dp"
android:layout_marginEnd="6dp"
android:layout_marginRight="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.079"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/relativeLayout2"
app:srcCompat="#drawable/triangle" />
<EditText
android:id="#+id/usernameLoginBox"
android:layout_width="300dp"
android:layout_height="40dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="112dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/edit_text_border"
android:ems="10"
android:hint=" Email"
android:inputType="textEmailAddress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView4"
tools:textColor="#color/colorBackground" />
<EditText
android:id="#+id/passwordLoginBox"
android:layout_width="300dp"
android:layout_height="40dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:background="#drawable/edit_text_border"
android:ems="10"
android:hint=" Password"
android:inputType="textEmailAddress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/usernameLoginBox"
tools:textColor="#color/colorBackground" />
<Button
android:id="#+id/signinButtonLogin"
android:layout_width="300dp"
android:layout_height="64dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#color/colorCoral"
android:text="LOGIN"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/passwordLoginBox" />
</android.support.constraint.ConstraintLayout>
I tried to make the marginTop -20dp to see if that would raise it at all, but it did nothing to fix the issue
Check out this
<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:background="#color/colorLightTan"
tools:context=".LoginActivity">
<FrameLayout
android:id="#+id/relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="80dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/relativeLayout"
app:layout_constraintVertical_bias="0.0">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="58dp"
android:background="#color/colorCoral"
android:orientation="horizontal">
<TextView
android:id="#+id/logintextBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginStart="49dp"
android:layout_marginLeft="49dp"
android:layout_weight="1"
android:font="#font/americancaptain"
android:text="Login"
android:textColor="#color/colorBackground"
android:textSize="26dp"
app:fontFamily="sans-serif-condensed" />
<TextView
android:id="#+id/logintextBar3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginStart="260dp"
android:layout_marginLeft="260dp"
android:layout_weight="1"
android:font="#font/americancaptain"
android:text="Register"
android:textColor="#color/colorBackground"
android:textSize="26dp"
app:fontFamily="sans-serif-condensed" />
<Button
android:id="#+id/registerButtonLogin"
android:layout_width="150dp"
android:layout_height="200dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:background="#android:color/transparent"
android:padding="0dp"
android:text="" />
</RelativeLayout>
<ImageView
android:id="#+id/imageView4"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginTop="50dp"
android:layout_marginLeft="35dp"
app:srcCompat="#drawable/triangle" />
</FrameLayout>
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="fill_parent"
android:layout_height="79dp"
android:background="#color/colorBackground"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="53dp"
android:layout_marginLeft="53dp"
android:layout_marginBottom="-33dp"
android:layout_weight="1"
android:paddingBottom="0dp"
app:srcCompat="#drawable/halfhalf" />
</RelativeLayout>
<EditText
android:id="#+id/usernameLoginBox"
android:layout_width="300dp"
android:layout_height="40dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="112dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="#drawable/edit_text_border"
android:ems="10"
android:hint=" Email"
android:inputType="textEmailAddress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/relativeLayout2"
tools:textColor="#color/colorBackground" />
<EditText
android:id="#+id/passwordLoginBox"
android:layout_width="300dp"
android:layout_height="40dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:background="#drawable/edit_text_border"
android:ems="10"
android:hint=" Password"
android:inputType="textEmailAddress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/usernameLoginBox"
tools:textColor="#color/colorBackground" />
<Button
android:id="#+id/signinButtonLogin"
android:layout_width="300dp"
android:layout_height="64dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#color/colorCoral"
android:text="LOGIN"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/passwordLoginBox" />
</android.support.constraint.ConstraintLayout>

How to set a scrollView to half of screen with ConstraintLayout

I have a ConstraintLayout with some view itens and a listView to show some values. I need to create a layout with HALF SCREEN and in the first layout i need to use a scrollView, to complete all infos and register. Can i set layout to half of screen with no using a fixing layout_height?
This is my layout, with a fixed layout_height :
and this is my layout code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="250dp"
android:id="#+id/myScrollView">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/txtViewExpense"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:text="#string/expense"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/txtExpenseValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpense" />
<TextView
android:id="#+id/txtViewPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="#string/expense_price"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseValue" />
<EditText
android:id="#+id/txtViewPriceValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPrice" />
<TextView
android:id="#+id/txtViewCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="#string/expense_category"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPriceValue" />
<Spinner
android:id="#+id/spnCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewCategory" />
<TextView
android:id="#+id/txtViewFrequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="#string/expense_frequency"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnCategory" />
<Spinner
android:id="#+id/spnFrequency"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewFrequency" />
<TextView
android:id="#+id/txtViewExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:text="#string/expense_date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnFrequency" />
<EditText
android:id="#+id/txtExpenseDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintLeft_toRightOf="#+id/txtExpenseDateValue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseDateValue" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="#+id/listViewExpense"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/myScrollView" />
</android.support.constraint.ConstraintLayout>
Any one can help me? Thx o/
Change the outer ConstraintLayout to LinearLayout. Then you have to set the layout weight to ScrollView and ListView. Layout weight will be 1 for these two views. So that, these views can be equally divided into the screen. This will be the updated code:
<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">
<ScrollView
android:id="#+id/myScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/txtViewExpense"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/txtExpenseValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpense" />
<TextView
android:id="#+id/txtViewPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseValue" />
<EditText
android:id="#+id/txtViewPriceValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPrice" />
<TextView
android:id="#+id/txtViewCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPriceValue" />
<Spinner
android:id="#+id/spnCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewCategory" />
<TextView
android:id="#+id/txtViewFrequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnCategory" />
<Spinner
android:id="#+id/spnFrequency"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewFrequency" />
<TextView
android:id="#+id/txtViewExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnFrequency" />
<EditText
android:id="#+id/txtExpenseDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintLeft_toRightOf="#+id/txtExpenseDateValue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseDateValue" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="#+id/listViewExpense"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1" />
</LinearLayout>
<?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="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/myScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/txtViewExpense"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/txtExpenseValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpense" />
<TextView
android:id="#+id/txtViewPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseValue" />
<EditText
android:id="#+id/txtViewPriceValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPrice" />
<TextView
android:id="#+id/txtViewCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPriceValue" />
<Spinner
android:id="#+id/spnCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewCategory" />
<TextView
android:id="#+id/txtViewFrequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnCategory" />
<Spinner
android:id="#+id/spnFrequency"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewFrequency" />
<TextView
android:id="#+id/txtViewExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnFrequency" />
<EditText
android:id="#+id/txtExpenseDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintLeft_toRightOf="#+id/txtExpenseDateValue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseDateValue" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="#+id/listViewExpense"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/myScrollView" />
</LinearLayout>
Try this
Easiest way to do it is to add a Guideline to your root ConstraintLayout at 50% of its height and constrain the bottom of the ScrollView to it and the top to the parent:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5"/>
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
android:id="#+id/myScrollView"
app:layout_constraintBottom_toTopOf="#id/guideline"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/txtViewExpense"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:text="#string/expense"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/txtExpenseValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpense" />
<TextView
android:id="#+id/txtViewPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="#string/expense_price"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseValue" />
<EditText
android:id="#+id/txtViewPriceValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPrice" />
<TextView
android:id="#+id/txtViewCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="#string/expense_category"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPriceValue" />
<Spinner
android:id="#+id/spnCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewCategory" />
<TextView
android:id="#+id/txtViewFrequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="#string/expense_frequency"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnCategory" />
<Spinner
android:id="#+id/spnFrequency"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewFrequency" />
<TextView
android:id="#+id/txtViewExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:text="#string/expense_date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnFrequency" />
<EditText
android:id="#+id/txtExpenseDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintLeft_toRightOf="#+id/txtExpenseDateValue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseDateValue" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="#+id/listViewExpense"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/myScrollView" />
</android.support.constraint.ConstraintLayout>
Use Guideline and put it in middle of screen and set your scrollview to above it
<?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="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/myScrollView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="5dp"
app:layout_constraintBottom_toTopOf="#+id/gl1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/txtViewExpense"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:text="expense"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/txtExpenseValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="textPersonName"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpense" />
<TextView
android:id="#+id/txtViewPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:text="expense_price"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseValue" />
<EditText
android:id="#+id/txtViewPriceValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="number"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPrice" />
<TextView
android:id="#+id/txtViewCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="expense_category"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewPriceValue" />
<Spinner
android:id="#+id/spnCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewCategory" />
<TextView
android:id="#+id/txtViewFrequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="expense_frequency"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnCategory" />
<Spinner
android:id="#+id/spnFrequency"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewFrequency" />
<TextView
android:id="#+id/txtViewExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:text="expense_date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spnFrequency" />
<EditText
android:id="#+id/txtExpenseDateValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:ems="10"
android:inputType="date"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnExpenseDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintLeft_toRightOf="#+id/txtExpenseDateValue"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtViewExpenseDate" />
<Button
android:id="#+id/btnRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="5dp"
android:text="Button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txtExpenseDateValue" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
<android.support.constraint.Guideline
android:id="#+id/gl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
<com.baoyz.swipemenulistview.SwipeMenuListView
android:id="#+id/listViewExpense"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/gl1" />
</android.support.constraint.ConstraintLayout>

Horizontal RecyclerView inside NestedScrollView, can't scroll vertically

I tried every combination of this, some people said it's a bug but I think it's something small I'm missing. With the follwing XML, I can't scroll at all, only the horizontal scroll works.
I have a side-scroll RecyclerView which I can drag left and right, but the page has more I items than can fit, hence the ScrollView.
At first I was aiming for a collapsable toolbar, but when I add CoordinatorLayout, the activity is just blank.
My XML:
<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:nestedScrollingEnabled="true"
app:layout_constraintTop_toBottomOf="#+id/scrollv"
tools:context="com.wearecatchapp.blueandwhite.catchapp_droid.EventDetailActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/detail_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#fff"
android:elevation="2dp"
android:minHeight="60dp"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/evt_title"
fontPath="fonts/PanameFY.otf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="30sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="2dp"
android:text="Organizer's level:"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<ImageView
android:id="#+id/org_level"
android:layout_width="60dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical" />
</LinearLayout>
<TextView
android:id="#+id/optional_title"
fontPath="fonts/PanameFY.otf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="2dp"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="24sp"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.NestedScrollView
android:id="#+id/scrollv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/detail_toolbar">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/activity_image"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:srcCompat="#color/black" />
<TextView
android:id="#+id/month"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="NOV"
android:textAlignment="center"
android:textColor="#android:color/holo_red_light"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/day"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="2dp"
android:text="15"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="24sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/month" />
<TextView
android:id="#+id/starts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Starts"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/month"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/ends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="7dp"
android:text="Ends"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/day"
app:layout_constraintTop_toBottomOf="#+id/starts" />
<TextView
android:id="#+id/start_date"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="42dp"
android:layout_marginStart="42dp"
android:layout_marginTop="8dp"
android:text=" 18:10 Wed, Nov 15"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/starts"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/textView34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginStart="50dp"
android:layout_marginTop="7dp"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/ends"
app:layout_constraintTop_toBottomOf="#+id/start_date" />
<View
android:id="#+id/view10"
id="#+id/view8"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#color/thegray"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout2" />
<View
android:id="#+id/view9"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="9dp"
android:background="#color/thegray"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView34" />
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="397dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView34">
<ImageView
android:id="#+id/requests_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/requestsicon" />
<ImageView
android:id="#+id/invite_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/invitefriends" />
<ImageView
android:id="#+id/recommend_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/recommend" />
<ImageView
android:id="#+id/share_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/shareblue" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="396dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout">
<TextView
android:id="#+id/requests_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Requests"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/invite_friends_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Invite friends"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/recommend_event_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Recommend"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/share_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Share"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="#+id/status_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingLeft="8dp"
android:textColor="#color/dark_gray"
android:textSize="20sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view10" />
<ImageView
android:id="#+id/is_for"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="6dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/status_text"
app:srcCompat="#drawable/maleandfemale" />
<TextView
android:id="#+id/going"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="15dp"
android:text="going"
android:textColor="#color/black"
app:layout_constraintLeft_toRightOf="#+id/is_for"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<TextView
android:id="#+id/more_togo"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:text="TextView"
android:textColor="#color/black"
app:layout_constraintLeft_toRightOf="#+id/hor_view"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<View
android:id="#+id/hor_view"
class="android.support.v4.widget.Space"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginLeft="35dp"
android:layout_marginStart="35dp"
android:layout_marginTop="8dp"
android:background="#color/dark_gray"
app:layout_constraintLeft_toRightOf="#+id/going"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<android.support.v7.widget.RecyclerView
android:id="#+id/participants_list"
android:layout_width="0dp"
android:layout_height="117dp"
android:layout_marginTop="12dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/hor_view" />
<View
android:id="#+id/view16"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/participants_list" />
<TextView
android:id="#+id/textView47"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="17dp"
android:text="Costs"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<TextView
android:id="#+id/cost_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="17dp"
android:text="TextView"
android:textSize="18sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<View
android:id="#+id/view19"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="55dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<TextView
android:id="#+id/cost_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="13dp"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view19" />
<View
android:id="#+id/view20"
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginTop="16dp"
android:background="#color/thegray"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view19" />
<ImageView
android:id="#+id/imageView15"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:padding="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view20"
app:srcCompat="#drawable/pinblue" />
<TextView
android:id="#+id/textView50"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_marginStart="7dp"
android:layout_marginTop="16dp"
android:text="Event location"
android:textColor="#color/colorPrimary"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/imageView15"
app:layout_constraintTop_toBottomOf="#+id/view20" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:padding="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView50"
app:srcCompat="#drawable/background" />
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginBottom="29dp"
android:layout_marginEnd="40dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginStart="40dp"
app:cardBackgroundColor="#color/colorPrimary"
app:cardCornerRadius="18dp"
app:cardElevation="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:text="REQUEST TO JOIN"
android:textColor="#android:color/white"
android:textSize="14dp" />
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
Someone pleeeease for the love of god explain this sh*t to me.
Try adding setNestedScrollingEnabled(false) to your inner recyclerview.
https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html
setNestedScrollingEnabled
Enable or disable nested scrolling for this view.
If this property is set to true the view will be permitted to initiate
nested scrolling operations with a compatible parent view in the
current hierarchy. If this view does not implement nested scrolling
this will have no effect. Disabling nested scrolling while a nested
scroll is in progress has the effect of stopping the nested scroll.
1)xml
android.support.v4.widget.NestedScrollView
inner use LinerLayout
2)
recyclerView = (RecyclerView)view.findViewById(R.id.recyclerview_main);
recyclerView.setNestedScrollingEnabled(false);
If someone still facing this issue, please take care of 2 things:
Your NestedScrollView height should be match_parent. If you are using NestedScrollView inside ConstraintLayout you can achive this by following line of code
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
Add below line in your RecyclerView
android:nestedScrollingEnabled="false"
I hope it will save others time.

How to add Scrollview that include Constraintlayout to a layout "scrollable constraintlayout"?

I have a complicated Layout that created with constraintlayout and i need to scroll Vertically some part of it with scroll view and of Course this scroll view must include constraintlayout too,
Is any Body can help ?
I bring My code maybe it could help
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryLight"
tools:context=".MainActivity"
tools:layout_editor_absoluteY="25dp">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideLineLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.02676399" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideLineRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.98053527" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineTop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.019151846" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideLineH20to25Percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.20519836" />
<EditText
android:id="#+id/edit_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:background="#color/colorPrimaryLight"
android:lines="1"
android:maxLength="20"
android:maxLines="1"
android:minWidth="75dp"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:paddingBottom="8dp"
android:textAlignment="center"
android:textColor="#e1e1e1"
android:textSize="22sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="#+id/guideLineRight"
app:layout_constraintStart_toStartOf="#+id/guideLineLeft"
app:layout_constraintTop_toTopOf="#+id/guidelineTop" />
<ImageView
android:id="#+id/get_location_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="btn_clicked"
android:src="#drawable/ic_send2"
app:layout_constraintBottom_toBottomOf="#+id/edit_city"
app:layout_constraintEnd_toEndOf="#+id/edit_city"
app:layout_constraintStart_toEndOf="#+id/edit_city"
app:layout_constraintTop_toTopOf="#+id/edit_city" />
<TextView
android:id="#+id/current_weather_condition_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:minWidth="100dp"
android:textAlignment="center"
android:textColor="#color/colorText"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="#+id/edit_city"
app:layout_constraintStart_toStartOf="#+id/edit_city"
app:layout_constraintTop_toBottomOf="#+id/edit_city" />
<TextView
android:id="#+id/current_weather_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="#fff"
android:textSize="32sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="#+id/current_weather_condition_view"
app:layout_constraintStart_toStartOf="#+id/current_weather_condition_view"
app:layout_constraintTop_toBottomOf="#+id/current_weather_condition_view" />
<TextView
android:id="#+id/todayNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="24dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintStart_toStartOf="#+id/guideLineLeft"
app:layout_constraintTop_toBottomOf="#+id/guideLineH20to25Percent" />
<TextView
android:id="#+id/todayView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Today"
android:textColor="#fff"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="#+id/todayNameView"
app:layout_constraintStart_toEndOf="#+id/todayNameView" />
<TextView
android:id="#+id/todayMinTemperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintBottom_toBottomOf="#+id/todayMaxTemperature"
app:layout_constraintEnd_toStartOf="#+id/guideLineRight"
app:layout_constraintTop_toTopOf="#+id/todayMaxTemperature" />
<TextView
android:id="#+id/todayMaxTemperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toStartOf="#+id/guideLineRight"
app:layout_constraintTop_toBottomOf="#+id/guideLineH20to25Percent" />
<View
android:id="#+id/view1"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="#FFF"
android:textAlignment="center"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/todayNameView" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:scrollbars="none"
app:layout_constraintEnd_toEndOf="#+id/guideLineRight"
app:layout_constraintStart_toStartOf="#+id/guideLineLeft"
app:layout_constraintTop_toBottomOf="#+id/view1">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineMiddleH"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recycler_view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:minHeight="100dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="#+id/view2"
android:layout_width="0dp"
android:layout_height="1dp"
android:background="#fff"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/recycler_view1" />
<ImageView
android:id="#+id/imgIcon1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toStartOf="#+id/guidelineMiddleH"
app:layout_constraintStart_toStartOf="#+id/guidelineMiddleH"
app:layout_constraintTop_toBottomOf="#+id/view2" />
<ImageView
android:id="#+id/imgIcon2"
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_constraintEnd_toEndOf="#+id/imgIcon1"
app:layout_constraintStart_toStartOf="#+id/imgIcon1"
app:layout_constraintTop_toBottomOf="#+id/imgIcon1" />
<ImageView
android:id="#+id/imgIcon3"
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_constraintEnd_toEndOf="#+id/imgIcon2"
app:layout_constraintStart_toStartOf="#+id/imgIcon2"
app:layout_constraintTop_toBottomOf="#+id/imgIcon2" />
<ImageView
android:id="#+id/imgIcon4"
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_constraintEnd_toEndOf="#+id/imgIcon3"
app:layout_constraintStart_toStartOf="#+id/imgIcon3"
app:layout_constraintTop_toBottomOf="#+id/imgIcon3" />
<ImageView
android:id="#+id/imgIcon5"
android:layout_width="35dp"
android:layout_height="35dp"
app:layout_constraintEnd_toEndOf="#+id/imgIcon4"
app:layout_constraintStart_toStartOf="#+id/imgIcon4"
app:layout_constraintTop_toBottomOf="#+id/imgIcon4" />
<TextView
android:id="#+id/firstDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon1" />
<TextView
android:id="#+id/secondDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon2"
app:layout_constraintVertical_bias="0.51" />
<TextView
android:id="#+id/thirdDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon3" />
<TextView
android:id="#+id/fourthDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon4" />
<TextView
android:id="#+id/fivthDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon5"/>
<TextView
android:id="#+id/maxTemp1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textAlignment="gravity"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon1" />
<TextView
android:id="#+id/maxTemp2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon2" />
<TextView
android:id="#+id/maxTemp3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon3" />
<TextView
android:id="#+id/maxTemp4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon4" />
<TextView
android:id="#+id/maxTemp5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/imgIcon5" />
<TextView
android:id="#+id/minTemp1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textAlignment="gravity"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/maxTemp1" />
<TextView
android:id="#+id/minTemp2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/maxTemp2" />
<TextView
android:id="#+id/minTemp3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/maxTemp3" />
<TextView
android:id="#+id/minTemp4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/maxTemp4" />
<TextView
android:id="#+id/minTemp5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textColor="#c5c5c5"
android:textSize="18sp"
android:textStyle="normal|bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/maxTemp5" />
<View
android:id="#+id/view3"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="#fff"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imgIcon5" />
<TextView
android:id="#+id/wind_name_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:text="Wind"
android:textColor="#color/colorPrimaryDark"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view3" />
<TextView
android:id="#+id/currentSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/wind_name_view" />
<TextView
android:id="#+id/pressure_name_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="PRESSURE"
android:textColor="#color/colorPrimaryDark"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="#+id/guidelineMiddleH"
app:layout_constraintTop_toBottomOf="#+id/currentFeelTemperature" />
<TextView
android:id="#+id/currentPressure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="#+id/pressure_name_view"
app:layout_constraintTop_toBottomOf="#+id/pressure_name_view" />
<TextView
android:id="#+id/feelLike_name_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="FEELS LIKE"
android:textColor="#color/colorPrimaryDark"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="#+id/guidelineMiddleH"
app:layout_constraintTop_toBottomOf="#+id/view3" />
<TextView
android:id="#+id/currentFeelTemperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="#+id/feelLike_name_view"
app:layout_constraintTop_toBottomOf="#+id/feelLike_name_view" />
<TextView
android:id="#+id/humidity_name_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:text="HUMIDITY"
android:textColor="#color/colorPrimaryDark"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/currentSpeed" />
<TextView
android:id="#+id/currentHumidity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#fff"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/humidity_name_view" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Try adding android:fillViewport="true" to the ScrollView.
Don't forget that If you constraint some view's bottom to constraint layout's bottom.Scrollview could not scroll.
app:layout_constraintBottom_toBottomOf=“parent”
It seems that it is working, I don't know what dependency you were working with but in this one
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Is working, this is what I did
<?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">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="#+id/view"
android:layout_width="377dp"
android:layout_height="2dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:background="#000000"
app:layout_constraintBottom_toTopOf="#+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.64" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="176dp"
android:layout_height="268dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="40dp"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="#+id/textView17"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0">
<TextView
android:id="#+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Account #"
android:textColor="#000000"
android:textSize="18sp" />
<!-- <TextView-->
<!-- android:id="#+id/textView9"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="#dimen/lintext"-->
<!-- android:text="Company Name "-->
<!-- android:textColor="#000000"-->
<!-- android:textSize="18sp" />-->
<TextView
android:id="#+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Phone"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Address"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Serial number"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Product name "
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Brand"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Subject"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="#+id/textView11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="#dimen/lintext"
android:text="Problem Details "
android:textColor="#000000"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout3"
android:layout_width="187dp"
android:layout_height="263dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/linearLayout2"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/from_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Ahmed hassen" />
<TextView
android:id="#+id/name_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="26 Horrya st ,helioplis 11341" />
<TextView
android:id="#+id/num_ser"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="+201111414141" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="CZ3351x4BW" />
<TextView
android:id="#+id/textView12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="Hp SL230 Gen8 Rht half Svr" />
<TextView
android:id="#+id/textView14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="Hp" />
<TextView
android:id="#+id/textView15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="Broken Screen" />
<TextView
android:id="#+id/textView16"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="12dp"
android:text="Broken Screen and we gonna replace it " />
</LinearLayout>
<ImageView
android:id="#+id/imageView9"
android:layout_width="377dp"
android:layout_height="70dp"
android:layout_marginTop="40dp"
android:src="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.328"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText4" />
<EditText
android:id="#+id/editText3"
android:layout_width="83dp"
android:layout_height="48dp"
android:layout_marginTop="60dp"
android:background="#drawable/style_et_border"
android:ems="10"
android:inputType="textPersonName"
android:text=" 500"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.536"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText4" />
<TextView
android:id="#+id/textView21"
android:layout_width="134dp"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:layout_marginRight="12dp"
android:text="Estimated Labor"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/editText3"
app:layout_constraintEnd_toStartOf="#+id/editText3"
app:layout_constraintTop_toTopOf="#+id/imageView9"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/textView22"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EGP"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="#+id/imageView9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.196"
app:layout_constraintStart_toEndOf="#+id/editText3"
app:layout_constraintTop_toTopOf="#+id/imageView9"
app:layout_constraintVertical_bias="0.695" />
<View
android:id="#+id/ll"
android:layout_width="377dp"
android:layout_height="3dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginTop="15dp"
android:background="#000000"
app:layout_constraintBottom_toBottomOf="#+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout3" />
<TextView
android:id="#+id/editText"
android:layout_width="376dp"
android:layout_height="93dp"
android:layout_marginTop="72dp"
android:layout_weight="1"
android:background="#drawable/style_et_border"
android:ems="10"
android:text="A dying or cracked display doesn't mean your laptop is a paperweight. For most laptops, a screen replacement takes"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="#+id/textView17"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.507"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout3"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:layout_marginBottom="8dp"
android:text="Problem Found "
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/editText"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/textView18"
android:layout_width="219dp"
android:layout_height="29dp"
android:layout_marginTop="64dp"
android:text="Spare Parts Selected"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.074"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView19" />
<TextView
android:id="#+id/editText4"
android:layout_width="412dp"
android:layout_height="49dp"
android:layout_marginTop="8dp"
android:background="#drawable/style_et_border"
android:ems="10"
android:text=" ** Kingston Kvr16N11/8 - 8Gb Ddr3 Pc3-12800 1600Mhz Non-Ecc Cl11 Desktop Memory "
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText5" />
<TextView
android:id="#+id/editText5"
android:layout_width="412dp"
android:layout_height="49dp"
android:background="#drawable/style_et_border"
android:ems="10"
android:text=" ** Kingston Kvr16N11/8 - 8Gb Ddr3 Pc3-12800 1600Mhz Non-Ecc Cl11 Desktop Memory "
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView18" />
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:text="Estimated time"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.085"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText" />
<TextView
android:id="#+id/editText2"
android:layout_width="134dp"
android:layout_height="30dp"
android:layout_marginTop="36dp"
android:background="#drawable/style_et_border"
android:ems="10"
android:text=" 6 Hours"
android:textColor="#000000"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.224"
app:layout_constraintStart_toEndOf="#+id/textView19"
app:layout_constraintTop_toBottomOf="#+id/editText" />
<in.shadowfax.proswipebutton.ProSwipeButton
android:id="#+id/awesome_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:bg_color="#android:color/holo_blue_dark"
app:btn_text="Close Your Ticket"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/button"
app:layout_constraintVertical_bias="0.027" />
<Button
android:id="#+id/button"
android:layout_width="230dp"
android:layout_height="45dp"
android:layout_marginTop="28dp"
android:background="#drawable/style_et_border"
android:onClick="goSignature"
android:text="put your signature here"
android:textAllCaps="false"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText3" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<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="match_parent">
<android.support.constraint.ConstraintLayout
android:id="#+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout>
</ScrollView>

Categories

Resources