layout_above of Relative layout in Constraint Layout? - android

Here is my code and I want ViewPager to above LinearLayout and below ImageView. It is coming below ImageView but overlaps LinearLayout. I tried layout_constarintBottom_toTopOf property but it's not working. Which property use correctly to solve this issue
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary">
<ImageView
android:id="#+id/img_app_logo"
android:layout_width="75dp"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:src="#drawable/app_logo"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintDimensionRatio="4:3"/>
<LinearLayout
android:id="#+id/linear_layout_registration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_get_started"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/get_started_text"
android:textSize="18sp"
android:padding="20dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="#color/white" />
<View
android:layout_width="1dp"
android:layout_height="30dp"
android:background="#color/white"
android:layout_gravity="center"/>
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_sign_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/sign_in_text"
android:textSize="18sp"
android:padding="20dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="#color/white" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/img_app_logo"/>
</android.support.constraint.ConstraintLayout>

Use match_constraint property for view pager height from design tab->attributes. It will adjust view pager according to its constraints.
<ImageView
android:id="#+id/img_app_logo"
android:layout_width="75dp"
android:layout_height="0dp"
android:src="#drawable/home"
app:layout_constraintDimensionRatio="4:3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintHorizontal_bias="0.501"
android:layout_marginTop="16dp" app:layout_constraintTop_toTopOf="parent"/>
<LinearLayout
android:id="#+id/linear_layout_registration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_get_started"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="get started"
android:textSize="18sp"
android:padding="20dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="#color/white" />
<View
android:layout_width="1dp"
android:layout_height="30dp"
android:background="#color/white"
android:layout_gravity="center"/>
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_sign_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign In"
android:textSize="18sp"
android:padding="20dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="#color/white" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintHorizontal_bias="0.0" android:id="#+id/viewPager"
app:layout_constraintTop_toBottomOf="#+id/img_app_logo"
app:layout_constraintBottom_toTopOf="#+id/linear_layout_registration"/>

You probably want something like 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">
<ImageView
android:id="#+id/img_app_logo"
android:layout_width="75dp"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:src="#drawable/app_logo"
app:layout_constraintDimensionRatio="4:3"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPager2"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="#+id/linear_layout_registration"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/img_app_logo" />
<LinearLayout
android:id="#+id/linear_layout_registration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_get_started"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="20dp"
android:text="#string/get_started_text"
android:textColor="#color/white"
android:textSize="18sp" />
<View
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:background="#color/white" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/text_sign_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="20dp"
android:text="#string/sign_in_text"
android:textColor="#color/white"
android:textSize="18sp" />
</LinearLayout>

Related

Height of linear layout doesn't increase as the width of linear layout increase in android studio

I am looking for a solution that if the width of the linear layout increases the height increases accordingly.
I want the height to increase as well when the width of the linear layout increase. Is it possible to have a solution using XML only.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/grafiti"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="1dp"
android:layout_marginLeft="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25sp"
app:cardCornerRadius="45dp"
app:cardElevation="5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="#font/alata"
android:text="BASE"
android:textAlignment="center"
android:textColor="#color/white"
android:textSize="48sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="horizontal"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical"
android:visibility="visible">
<ImageView
android:id="#+id/imageView6"
android:layout_width="match_parent"
android:layout_height="250dip"
android:scaleType="centerCrop"
app:srcCompat="#drawable/tictactoemain" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3">
<ImageView
android:id="#+id/gifImageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:src="#drawable/tictactoe_gif"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="#+id/roundstab"
android:layout_width="match_parent"
android:layout_height="120sp"
android:background="#color/transparent"
android:orientation="horizontal"
android:visibility="visible">
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginBottom="5dp"
android:layout_weight="10"
app:cardBackgroundColor="#color/card_grey"
app:cardCornerRadius="15sp"
app:cardElevation="5sp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50sp"
android:layout_marginLeft="10sp"
android:layout_marginTop="10sp"
android:layout_marginBottom="8sp"
android:orientation="horizontal">
<ImageButton
android:id="#+id/imageButton2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#color/transparent"
android:scaleType="fitCenter"
app:srcCompat="#drawable/minus" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="#drawable/custom_spinner_border"
app:boxBackgroundMode="none"
app:errorEnabled="false">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:padding="0dp"
android:text="5"
android:textAlignment="center" />
</com.google.android.material.textfield.TextInputLayout>
<ImageButton
android:id="#+id/imageButton3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#color/transparent"
android:scaleType="fitCenter"
app:srcCompat="#drawable/plus" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="250sp"
android:layout_weight="6"
android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="#+id/button3"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_weight="1"
android:text="START"
app:cornerRadius="45sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.697" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</ScrollView>
Any solution for the height?
The image on the right is where the issue is. the height remains constant while the width increases due to which the screen streches.

Android Constarint Layout ScrollView and Bottom Issue Landscape

I am using constraint layout for my page and it is working good if it in portrait but views are overlapping when it is landscape mode. I have added scroll view also , but still it is overlapping only.I need the card view should be present in the bottom and in landscape mode it should be visible while scrolling... I know the issue is because of that card view (cv_items).I don't know how to fix this issue.
Here is my xml,
<?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:fillViewport="true"
android:background="#000000"
android:layout_height="match_parent">
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginBottom="0dp"
app:layout_constraintBottom_toTopOf="#+id/cv_item">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_title"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="#dimen/_20sdp"
android:text="#string/you_got_req"
android:textColor="#color/light3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
android:id="#+id/cv_center"
android:layout_width="#dimen/_150sdp"
android:layout_height="#dimen/_150sdp"
android:layout_gravity="center"
android:layout_marginTop="#dimen/_30sdp"
android:orientation="vertical"
app:cardBackgroundColor="#color/light3"
app:cardCornerRadius="#dimen/_150sdp"
app:cardElevation="#dimen/_10sdp"
app:contentPadding="#dimen/_2sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_title">
<androidx.cardview.widget.CardView
android:id="#+id/cv_accept"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="#dimen/_10sdp"
app:cardBackgroundColor="#555555"
app:cardCornerRadius="#dimen/_150sdp">
<androidx.appcompat.widget.AppCompatTextView
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/accept"
android:textColor="#color/white"
android:textSize="#dimen/_15ssp" />
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<androidx.cardview.widget.CardView
android:id="#+id/cv_item"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_marginBottom="-25dp"
app:cardCornerRadius="#dimen/_15sdp"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_max="#dimen/_200sdp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_order_number"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_20sdp"
android:layout_marginTop="#dimen/_20sdp"
android:gravity="center_vertical"
android:textColor="#color/black"
android:textSize="16sp"
tools:text="#123456789" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_no_of_items"
style="#style/regularTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_order_number"
android:layout_marginStart="#dimen/_20sdp"
android:layout_marginTop="#dimen/_5sdp"
android:gravity="center_vertical"
android:textColor="#color/gray"
tools:text="6" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_items"
style="#style/regularTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_order_number"
android:layout_alignBaseline="#+id/tv_no_of_items"
android:layout_marginStart="5dp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_toEndOf="#+id/tv_no_of_items"
android:gravity="center_vertical"
android:text="#string/items"
android:textColor="#color/gray"
/>
<androidx.cardview.widget.CardView
android:id="#+id/cv_price"
android:layout_width="#dimen/_50sdp"
android:layout_height="#dimen/_30sdp"
android:layout_alignParentEnd="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_marginEnd="20dp"
android:gravity="center"
app:cardBackgroundColor="#color/colorPrimaryDark"
app:cardCornerRadius="#dimen/_15sdp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_amount"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#color/white"
android:textSize="#dimen/_10ssp"
tools:text="1233 RS" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<View
android:id="#+id/divider1"
android:layout_width="match_parent"
android:layout_height="#dimen/dp_half"
android:layout_below="#id/tv_items"
android:layout_margin="#dimen/_10sdp"
android:background="#color/light4" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_items"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/divider1"
android:layout_marginStart="#dimen/_10sdp"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_marginBottom="#dimen/_20sdp"
tools:itemCount="20"
tools:listitem="#layout/recycler_test_details" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
Please refer the screenshots.
Try to put everything inside ScrollView. Check below:
<?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:background="#000000"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="#+id/cv_item">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_title"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="#dimen/_20sdp"
android:text="#string/you_got_req"
android:textColor="#color/light3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
android:id="#+id/cv_center"
android:layout_width="#dimen/_150sdp"
android:layout_height="#dimen/_150sdp"
android:layout_gravity="center"
android:layout_marginTop="#dimen/_30sdp"
android:orientation="vertical"
app:cardBackgroundColor="#color/light3"
app:cardCornerRadius="#dimen/_150sdp"
app:cardElevation="#dimen/_10sdp"
app:contentPadding="#dimen/_2sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_title">
<androidx.cardview.widget.CardView
android:id="#+id/cv_accept"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="#dimen/_10sdp"
app:cardBackgroundColor="#555555"
app:cardCornerRadius="#dimen/_150sdp">
<androidx.appcompat.widget.AppCompatTextView
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="#string/accept"
android:textColor="#color/white"
android:textSize="#dimen/_15ssp" />
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:id="#+id/cv_item"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_marginBottom="-25dp"
app:cardCornerRadius="#dimen/_15sdp"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_max="#dimen/_200sdp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_order_number"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_20sdp"
android:layout_marginTop="#dimen/_20sdp"
android:gravity="center_vertical"
android:textColor="#color/black"
android:textSize="16sp"
tools:text="#123456789" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_no_of_items"
style="#style/regularTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_order_number"
android:layout_marginStart="#dimen/_20sdp"
android:layout_marginTop="#dimen/_5sdp"
android:gravity="center_vertical"
android:textColor="#color/gray"
tools:text="6" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_items"
style="#style/regularTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_order_number"
android:layout_alignBaseline="#+id/tv_no_of_items"
android:layout_marginStart="5dp"
android:layout_marginTop="#dimen/_5sdp"
android:layout_toEndOf="#+id/tv_no_of_items"
android:gravity="center_vertical"
android:text="#string/items"
android:textColor="#color/gray"
/>
<androidx.cardview.widget.CardView
android:id="#+id/cv_price"
android:layout_width="#dimen/_50sdp"
android:layout_height="#dimen/_30sdp"
android:layout_alignParentEnd="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_marginEnd="20dp"
android:gravity="center"
app:cardBackgroundColor="#color/colorPrimaryDark"
app:cardCornerRadius="#dimen/_15sdp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_amount"
style="#style/semiBoldTextInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#color/white"
android:textSize="#dimen/_10ssp"
tools:text="1233 RS" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<View
android:id="#+id/divider1"
android:layout_width="match_parent"
android:layout_height="#dimen/dp_half"
android:layout_below="#id/tv_items"
android:layout_margin="#dimen/_10sdp"
android:background="#color/light4" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_items"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/divider1"
android:layout_marginStart="#dimen/_10sdp"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_marginBottom="#dimen/_20sdp"
tools:itemCount="20"
tools:listitem="#layout/recycler_test_details" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

fill rest of the space using linearlayout

I have a FoodCardFragment that has a CardView at the bottom. I want the CardView to have a height of at least 120dp and fill the rest of the space (so I set its layout_weight to 1).
The FoodCardFragment is put in the RandomFragment (the first tab of MainAcitivity), and also has its layout_weight set to 1 as I want it to fill the rest of the space.
However, as you can tell from the image I posted below, the yellow CardView I mentioned above doesn't fill the rest of the space. How can I achieve my goal?
In case the links won't work:
Code for FoodCardFragment:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp"
android:background="#android:color/white">
<android.support.v7.widget.CardView
android:id="#+id/food_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:elevation="2dp">
<android.support.constraint.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/food_image"
android:layout_width="320dp"
android:layout_height="320dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/food_image_place_holder" />
<ImageView
android:id="#+id/liked_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_undo_like" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<TextView
android:id="#+id/food_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="24sp"
android:textStyle="bold"
android:layout_weight="1"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginEnd="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/food_card" />
<ImageButton
android:id="#+id/more_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#android:color/transparent"
android:src="#drawable/ic_dropdown" />
</LinearLayout>
<FrameLayout
android:id="#+id/tags_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="10dp" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:minHeight="120dp">
<TextView
android:id="#+id/food_note_back"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/food_note_background"
android:scrollbars="vertical"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingHorizontal="8dp" />
<TextView
android:id="#+id/food_note_front"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/food_note_background"
android:scrollbars="vertical"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingHorizontal="8dp" />
</android.support.v7.widget.CardView>
</LinearLayout>
Code for RandomFragment:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#color/whiteSmoke">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/colorBackgroundFloating"
android:elevation="2dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/title_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/random"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="#+id/filter_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:background="#android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/menu_button"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_filter" />
<ImageButton
android:id="#+id/menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="#android:color/transparent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_menu" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.CardView
android:id="#+id/food_card_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_weight="1"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="30dp"
android:background="#android:color/white"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">
<FrameLayout
android:id="#+id/food_card_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp">
<ImageButton
android:id="#+id/check_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/transparent"
android:padding="8dp"
app:srcCompat="#drawable/ic_check" />
<ImageButton
android:id="#+id/cross_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/transparent"
android:padding="8dp"
app:srcCompat="#drawable/ic_cross" />
<ImageButton
android:id="#+id/refresh_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#android:color/transparent"
android:padding="8dp"
app:srcCompat="#drawable/ic_refresh" />
</LinearLayout>
</LinearLayout>

Setting height to match contraint in constrainlyout is shrinking the height of the view

I have 3 card layouts in ConstraintLayout. I wanted to match the height of the second and third card layouts in the row to match with the first card layout.
So I added the lines conditions TopToTop of and BottomToBottom Of. And I set the height to 0dp (match constraints in design view). Surprisingly, second and third card layout heights are being centred and not matched. Please help me with this issue.
And for some reason, I am getting double shaded images in each card layout. I am not sure why.
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="#+id/rlHeader"
android:layout_width="0dp"
android:layout_height="#dimen/_40dp"
android:background="#color/action_color"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="#dimen/_0dp"
android:paddingEnd="#dimen/_10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/imgMenu"
android:layout_width="#dimen/_20dp"
android:layout_height="#dimen/_20dp"
android:layout_centerVertical="true"
android:layout_marginStart="#dimen/_10dp"
android:contentDescription="#null"
android:src="#drawable/icon_menu" />
<TextView
android:id="#+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:layout_marginStart="#dimen/_10dp"
android:fontFamily="#font/proxima_nova_semibold"
android:text="#string/pick_a_service"
android:textColor="#color/white"
android:textSize="#dimen/_18sp" />
</RelativeLayout>
<androidx.cardview.widget.CardView
android:id="#+id/card_home1"
style="#style/cardHome"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
app:cardBackgroundColor="#color/colorAccent1"
app:layout_constraintEnd_toStartOf="#+id/card_home5"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rlHeader">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="#dimen/_2dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/featureText1"
style="#style/textHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_2dp"
android:layout_weight="0.1"
android:text="#string/verification" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_home5"
style="#style/cardHome"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
app:cardBackgroundColor="#color/colorAccent5"
app:cardElevation="0dp"
app:layout_constraintBottom_toBottomOf="#id/card_home1"
app:layout_constraintEnd_toStartOf="#+id/card_home8"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/card_home1"
app:layout_constraintTop_toTopOf="#id/card_home1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="#dimen/_2dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/featureText5"
style="#style/textHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_2dp"
android:layout_weight="0.1"
android:text="#string/verification" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_home8"
style="#style/cardHome"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
app:cardBackgroundColor="#color/colorAccent3"
app:layout_constraintBottom_toBottomOf="#id/card_home1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/card_home5"
app:layout_constraintTop_toTopOf="#+id/card_home1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="#dimen/_2dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:id="#+id/featureText8"
style="#style/textHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/_2dp"
android:layout_weight="0.1"
android:text="#string/verification" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<RelativeLayout
android:id="#+id/progressBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ProgressBar
style="?android:attr/progressBarStyleLarge"
android:layout_width="#dimen/_50dp"
android:layout_height="#dimen/_50dp"
android:layout_centerInParent="true"
android:background="#drawable/progress_dialog_back"
android:indeterminate="false"
android:indeterminateTint="#color/white"
android:max="100"
android:padding="#dimen/_5dp"
android:progress="0"
android:visibility="visible"
tools:targetApi="lollipop" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
ConstaintLayout is not meant to have inner view groups. Its all about flat view hierarchy - so you can avoid using all of your inner view groups and just use chains:
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
app:layout_constraintBottom_toBottomOf="#+id/button2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/button2"
app:layout_constraintTop_toTopOf="#+id/button2" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Button"
app:layout_constraintEnd_toStartOf="#+id/button"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/button3"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/button3"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="Button"
app:layout_constraintBottom_toBottomOf="#+id/button2"
app:layout_constraintEnd_toStartOf="#+id/button2"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/button2" />
</androidx.constraintlayout.widget.ConstraintLayout>
Below is the XML file, hope this helps:
<?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"
tools:context=".MainActivity">
<android.support.v7.widget.CardView
android:id="#+id/label_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="#+id/label_b"
app:layout_constraintTop_toTopOf="parent"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="#color/colorAccent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:text="Verification" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/label_b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintStart_toEndOf="#id/label_a"
app:layout_constraintEnd_toStartOf="#+id/label_c"
app:layout_constraintTop_toTopOf="parent"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="#color/colorPrimaryDark"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:text="Verification" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/label_c"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintStart_toEndOf="#id/label_b"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="#color/colorPrimary"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.9"
android:scaleType="fitCenter"
android:src="#mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:text="Verification" />
</LinearLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>

Page Scroll Problems with CardView and ListView

I have a XML layout as follows:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/accounts_details_page_background_color">
<android.support.v7.widget.CardView
android:id="#+id/overview_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp"
card_view:ignore="PrivateResource">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp">
<TextView
android:id="#+id/fragment_compliance_details_overview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/compliance_details_fragment_overview"
android:textColor="#color/compliance_overview_title_color"
android:textSize="#dimen/text_size_small"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/policy_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:textColor="#color/black"
android:textSize="#dimen/text_size_large"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/fragment_compliance_details_overview" />
<TextView
android:id="#+id/last_check_time_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/policy_name" />
<View
android:id="#+id/horizontal_line_compliance"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?android:attr/listDivider"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time_only" />
<TextView
android:id="#+id/compliance_policy_status_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/horizontal_line_compliance" />
<TextView
android:id="#+id/last_check_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/last_compliance_check_time"
android:textSize="#dimen/text_size_small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/compliance_policy_status_explanation" />
<TextView
android:id="#+id/compliance_user_action_advice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/compliance_user_advice"
android:textSize="#dimen/text_size_small"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/details_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="#color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/overview_cardview"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="#+id/policy_details_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/policy_details_title"
android:textColor="#color/compliance_overview_title_color"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="gone" />
<ListView
android:id="#+id/compliance_rules_listview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
When the ListView has more than 3-4 rows the page does not scroll. The ListView does not scroll either.
I tried wrapping the whole thing in a NestedScrollView but that just gets the ListView scrolling and not even entirely.
I want the entire page to scroll and end scrolling when the ListView ends. Any ideas would help.
You don't need constraint layout for what you are doing.
Read about view weights.
Try this. (replace androix.* for your components)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="#+id/overview_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#color/white"
app:cardUseCompatPadding="true"
app:contentPadding="4dp"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/fragment_compliance_details_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/policy_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
android:textColor="#color/black"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/fragment_compliance_details_overview" />
<TextView
android:id="#+id/last_check_time_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/policy_name" />
<View
android:id="#+id/horizontal_line_compliance"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="?android:attr/listDivider" />
<TextView
android:id="#+id/compliance_policy_status_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/horizontal_line_compliance" />
<TextView
android:id="#+id/last_check_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="test"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/compliance_policy_status_explanation" />
<TextView
android:id="#+id/compliance_user_action_advice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="#string/has_accepted_your_invitation_to_fynd"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/last_check_time" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/details_cardview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#color/white"
app:cardUseCompatPadding="true"
app:contentPadding="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/overview_cardview"
app:layout_constraintVertical_bias="0.0"
card_view:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/policy_details_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="test"
android:textSize="14sp"
android:textStyle="bold" />
<ListView
android:id="#+id/compliance_rules_listview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

Categories

Resources