How can I make such a RadioButton in Android.
I made Layout like this, but I think it can somehow be done using the RadioButton class itself. I tried to add child to RadioButton tag but it threw exception
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="John Dore"
app:layout_constraintBottom_toTopOf="#+id/textView2"
app:layout_constraintStart_toEndOf="#+id/rb1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Score: 11"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="#+id/textView"
app:layout_constraintTop_toBottomOf="#+id/textView" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="Rate: 3"
app:layout_constraintStart_toEndOf="#+id/textView2"
app:layout_constraintTop_toBottomOf="#+id/textView" />
</androidx.constraintlayout.widget.ConstraintLayout>
You can create a xml and use it with a recyclerView.
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:layout_editor_absoluteX="112dp"
tools:layout_editor_absoluteY="61dp"
>
<RadioButton
android:id="#+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="John Dore" />
<TextView
android:id="#+id/textDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="Score: 11 Rate: 3" />
</LinearLayout>
</LinearLayout>
Related
I am currently making a very simple app. However, there is this massive white space at the top of the screen and I don't know what is causing it or how I could remove it. All I have in my XML are a few textviews and a radiogroup, so I'm not sure what is causing the black space.
Here is my XML code:
<?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"
tools:context=".ui.home.HomeFragment"
android:layout_margin="20sp">
<TextView
android:id="#+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="Find fragment"
android:textStyle="bold"
android:textColor="#color/design_default_color_primary_dark"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="50sp"
android:text="Select the desired type of tea"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.155" />
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/textView2">
<RadioButton
android:id="#+id/greentea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Green Tea" />
<RadioButton
android:id="#+id/blacktea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Black Tea" />
<RadioButton
android:id="#+id/herbaltea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Herbal Tea" />
<RadioButton
android:id="#+id/alltea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="All" />
</RadioGroup>
<com.google.android.material.button.MaterialButton
android:layout_width="170sp"
android:layout_height="60sp"
android:layout_marginTop="20sp"
android:text="Go to results"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/radioGroup" />
</androidx.constraintlayout.widget.ConstraintLayout>
Any help would be greatly appreciated!
It's the layout_margin that is pushing down the margin at the top. When you use layout_margin, it applies to all direction.
<?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"
tools:context=".ui.home.HomeFragment"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="20dp">
<TextView
android:id="#+id/text_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="Find fragment"
android:textStyle="bold"
android:textColor="#color/design_default_color_primary_dark"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="50sp"
android:text="Select the desired type of tea"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.155" />
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/textView2">
<RadioButton
android:id="#+id/greentea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Green Tea" />
<RadioButton
android:id="#+id/blacktea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Black Tea" />
<RadioButton
android:id="#+id/herbaltea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Herbal Tea" />
<RadioButton
android:id="#+id/alltea"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="All" />
</RadioGroup>
<com.google.android.material.button.MaterialButton
android:layout_width="170sp"
android:layout_height="60sp"
android:layout_marginTop="20sp"
android:text="Go to results"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/radioGroup" />
</androidx.constraintlayout.widget.ConstraintLayout>
This is my first ask on StackOverflow. a Greetings.
I am using Android Studio, I'm trying to make a Layout that the textView is just below and centered on another TextView. Actually, I have it like this.
Want to ask how I can do something like this:
To center it and be "responsive" with the superior text view. Thank you so much.
this is the code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="#dimen/activity_horizontal_margin">
<ImageView
android:id="#+id/imgPartidasRecomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="#dimen/activity_horizontal_margin"
android:src="#drawable/ic_star" />
<TextView
android:id="#+id/tv_perfil_partidasJugadas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/activity_horizontal_margin"
android:layout_toEndOf="#id/imgPartidasRecomendaciones"
android:background="#android:color/transparent"
android:text="Partidas"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_perfil_recomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_toEndOf="#id/tv_perfil_partidasJugadas"
android:background="#android:color/transparent"
android:text="Recomendaciones"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_partidasJugadasNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/tv_perfil_partidasJugadas"
android:layout_alignParentBottom="true"
android:layout_marginStart="#dimen/activity_horizontal_margin"
android:layout_toEndOf="#id/imgPartidasRecomendaciones"
android:layout_marginBottom="10dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
<TextView
android:id="#+id/tv_recomendacionesNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/tv_perfil_partidasJugadas"
android:layout_alignParentBottom="true"
android:layout_marginStart="60dp"
android:layout_toEndOf="#id/tv_partidasJugadasNumber"
android:layout_marginBottom="10dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
</RelativeLayout>
The solution is to wrap each pair of TextViews inside a vertical LinearLayout:
<ImageView
android:id="#+id/imgPartidasRecomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="#dimen/activity_horizontal_margin"
android:src="#drawable/ic_star" />
<LinearLayout
android:id="#+id/leftLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/activity_horizontal_margin"
android:layout_marginBottom="10dp"
android:layout_toEndOf="#id/imgPartidasRecomendaciones"
android:orientation="vertical">
<TextView
android:id="#+id/tv_perfil_partidasJugadas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:text="Partidas"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_partidasJugadasNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/activity_horizontal_margin"
android:text="0"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/rightLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toEndOf="#id/leftLayout"
android:layout_marginStart="60dp"
android:layout_marginBottom="10dp">
<TextView
android:id="#+id/tv_perfil_recomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:text="Recomendaciones"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_recomendacionesNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:text="0"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
You can put every pair of textViews inside vertical LinearLayout but you better use constraint layout - it is a better layout for responsive screen building and easy to integrate with, here is a good example of using it:
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="#color/buttonColor"
android:text="view"
android:textColor="#color/textMainColour"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="19dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="#color/buttonColor"
android:text="view"
android:textColor="#color/textMainColour"
app:layout_constraintBottom_toTopOf="#+id/textView10"
app:layout_constraintEnd_toStartOf="#+id/guideline3"
app:layout_constraintStart_toStartOf="#+id/guideline2" />
<TextView
android:id="#+id/textView5"
android:layout_width="0dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:background="#color/buttonColor"
android:text="view"
android:textColor="#color/textMainColour"
app:layout_constraintEnd_toEndOf="#+id/textView4"
app:layout_constraintStart_toStartOf="#+id/textView4"
app:layout_constraintTop_toBottomOf="#+id/textView10" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/buttonColor"
android:text="view"
android:textColor="#color/textMainColour"
app:layout_constraintBottom_toBottomOf="#+id/textView5"
app:layout_constraintEnd_toEndOf="#+id/textView8"
app:layout_constraintStart_toStartOf="#+id/textView8"
app:layout_constraintTop_toTopOf="#+id/textView5"
app:layout_constraintVertical_bias="0.0" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="55dp"
app:layout_constraintGuide_percent="0.2" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="146dp"
app:layout_constraintGuide_percent="0.6" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="#color/buttonColor"
android:text="view"
android:textColor="#color/textMainColour"
app:layout_constraintBottom_toBottomOf="#+id/textView4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textView4"
app:layout_constraintTop_toTopOf="#+id/textView4" />
</androidx.constraintlayout.widget.ConstraintLayout>
You can nest multiple layouts (LinearLayout, RelativeLayout, CoordinatorLayout) to achieve what you want.
If I understand what you asked, you are probably looking for something like this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="16dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="#+id/rl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imgPartidasRecomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:src="#drawable/ic_launcher_foreground" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/rl1"
android:layout_toRightOf="#+id/rl1">
<TextView
android:id="#+id/tv_perfil_partidasJugadas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:background="#android:color/transparent"
android:text="Partidas"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_partidasJugadasNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="10dp"
android:layout_below="#id/tv_perfil_partidasJugadas"
android:layout_centerInParent="true"
android:text="0"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="#+id/rl2"
android:layout_toRightOf="#+id/rl2">
<TextView
android:id="#+id/tv_perfil_recomendaciones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginLeft="60dp"
android:background="#android:color/transparent"
android:text="Recomendaciones"
android:textAppearance="#style/TextAppearance.AppCompat.Small"
android:textColor="#727272" />
<TextView
android:id="#+id/tv_recomendacionesNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/tv_perfil_recomendaciones"
android:layout_alignParentBottom="true"
android:layout_marginStart="60dp"
android:layout_marginLeft="60dp"
android:layout_marginBottom="10dp"
android:text="0"
android:layout_centerInParent="true"
android:textAlignment="center"
android:textAppearance="#style/TextAppearance.AppCompat.Medium"
android:textColor="#212121"
android:textSize="20sp" />
</RelativeLayout>
</RelativeLayout>
I suggest you to use Constraint Layout to build better responsive layouts (easier).
i am using contraint layout to align my textview in each corner of the screen but it looks like it is not working. the text on the right size of the screen gets align according to text length on the left size. take a look at the attach pic. text on the right is not properly align. for some reason there are a few spaces off. how can fix that?
<?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="wrap_content">
<TextView
android:id="#+id/payout_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/black"
android:text="#string/payout_label"
app:layout_constraintBottom_toTopOf="#+id/income_icon"/>
<ImageView
android:id="#+id/income_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="30dp"
android:layout_marginStart="8dp"
android:layout_marginBottom="-50dp"
android:padding="1dp"
android:scaleType="centerCrop"
android:src="#drawable/ic_income"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="#+id/category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/black"
android:text="Salary"
app:layout_constraintTop_toTopOf="#+id/income_icon"
app:layout_constraintStart_toEndOf="#+id/income_icon"
/>
<TextView
android:id="#+id/income_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$0.00"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.91"
app:layout_constraintStart_toEndOf="#+id/category"
app:layout_constraintTop_toTopOf="#+id/income_icon" />
<TextView
android:id="#+id/frequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="-5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/grey"
android:text="Monthly"
app:layout_constraintStart_toEndOf="#+id/income_icon"
app:layout_constraintBottom_toBottomOf="#+id/income_icon" />
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pending"
android:textAppearance="#style/TextAppearance.AppCompat.Body2"
android:textColor="#color/grey"
app:layout_constraintBottom_toBottomOf="#+id/income_icon"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.91"
app:layout_constraintStart_toEndOf="#+id/frequency" />
</android.support.constraint.ConstraintLayout>
If you want the amount to be right-justified and aligned, you don't need the following two lines of XML:
app:layout_constraintHorizontal_bias="0.91"
app:layout_constraintStart_toEndOf="#+id/category"
So, just delete them to give the following:
<TextView
android:id="#+id/income_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$0.00"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/income_icon" />
If you need a margin on the right of, say, 16dp, add:
android:layout_marginEnd="16dp"
your mistakes are these - you must remove these
this line in income_amount
app:layout_constraintStart_toEndOf="#+id/category"
this line in status
app:layout_constraintStart_toEndOf="#+id/frequency"
this is correct design
<?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="wrap_content">
<TextView
android:id="#+id/payout_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/black"
android:text="payout_label"
app:layout_constraintBottom_toTopOf="#+id/income_icon"/>
<ImageView
android:id="#+id/income_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="30dp"
android:layout_marginStart="8dp"
android:layout_marginBottom="-50dp"
android:padding="1dp"
android:scaleType="centerCrop"
android:src="#drawable/leak_canary_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="#+id/category"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="8dp"
android:text="Salary"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/black"
app:layout_constraintEnd_toStartOf="#+id/income_amount"
app:layout_constraintStart_toEndOf="#+id/income_icon"
app:layout_constraintTop_toTopOf="#+id/income_icon"/>
<TextView
android:id="#+id/income_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="$0.00"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/green"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#+id/income_icon"/>
<TextView
android:id="#+id/frequency"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="-5dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="8dp"
android:text="Monthly"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/grey"
app:layout_constraintBottom_toBottomOf="#+id/income_icon"
app:layout_constraintEnd_toStartOf="#+id/status"
app:layout_constraintStart_toEndOf="#+id/income_icon"/>
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="Pending"
android:textAppearance="#style/TextAppearance.AppCompat.Body2"
android:textColor="#color/grey"
app:layout_constraintBottom_toBottomOf="#+id/income_icon"
app:layout_constraintEnd_toEndOf="parent"/>
</android.support.constraint.ConstraintLayout>
I have aligned the status TextView to amount TextView and have given an 8 dp from right to status TextView so that it aligns to the amount TextView. Below is the code for 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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/payout_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:text="payout_label"
app:layout_constraintBottom_toTopOf="#+id/income_icon"/>
<ImageView
android:id="#+id/income_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="30dp"
android:layout_marginStart="8dp"
android:layout_marginBottom="-50dp"
android:padding="1dp"
android:scaleType="centerCrop"
android:src="#drawable/ic_launcher_background"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_chainStyle="packed"
android:layout_marginLeft="8dp" />
<TextView
android:id="#+id/category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/black"
android:text="Salary"
app:layout_constraintTop_toTopOf="#+id/income_icon"
app:layout_constraintStart_toEndOf="#+id/income_icon"
android:layout_marginLeft="5dp"
android:layout_marginRight="16dp" />
<TextView
android:id="#+id/income_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$0.00"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#android:color/holo_green_light"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.91"
app:layout_constraintStart_toEndOf="#+id/category"
app:layout_constraintTop_toTopOf="#+id/income_icon" />
<TextView
android:id="#+id/frequency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="-5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#android:color/darker_gray"
android:text="Monthly"
app:layout_constraintStart_toEndOf="#+id/income_icon"
app:layout_constraintBottom_toBottomOf="#+id/income_icon"
android:layout_marginLeft="5dp"
android:layout_marginRight="16dp" />
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Pending"
android:textAppearance="#style/TextAppearance.AppCompat.Body2"
android:textColor="#android:color/darker_gray"
app:layout_constraintBottom_toBottomOf="#+id/income_icon"
app:layout_constraintEnd_toEndOf="#+id/income_amount"
app:layout_constraintStart_toStartOf="#+id/income_amount" />
</android.support.constraint.ConstraintLayout>
Hope that helps!!!!
Design your layout like below.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="#dimen/_5sdp">
<TextView
android:id="#+id/payout_date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/_5sdp"
android:maxLines="1"
android:text="payout_label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/color_black"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/income_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="#dimen/_5sdp"
android:padding="1dp"
android:scaleType="centerCrop"
android:src="#drawable/ic_inbox_active"
app:layout_constraintLeft_toLeftOf="#+id/payout_date"
app:layout_constraintTop_toBottomOf="#+id/payout_date"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="30dp" />
<TextView
android:id="#+id/category"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Salary"
android:layout_marginRight="#dimen/_5sdp"
android:layout_marginStart="#dimen/_5sdp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/color_black"
app:layout_constraintLeft_toRightOf="#+id/income_icon"
app:layout_constraintRight_toLeftOf="#+id/income_amount"
app:layout_constraintTop_toTopOf="#+id/income_icon"
tools:layout_editor_absoluteX="61dp"
tools:layout_editor_absoluteY="34dp" />
<TextView
android:id="#+id/income_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$0.00"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#color/color_black"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/payout_date"
tools:layout_editor_absoluteX="344dp"
tools:layout_editor_absoluteY="30dp" />
<TextView
android:id="#+id/frequency"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Monthly"
app:layout_constraintLeft_toLeftOf="#+id/category"
app:layout_constraintTop_toBottomOf="#+id/category"
app:layout_constraintRight_toLeftOf="#+id/status"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/color_black"
tools:layout_editor_absoluteX="61dp"
tools:layout_editor_absoluteY="59dp" />
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pending"
android:textAppearance="#style/TextAppearance.AppCompat.Body2"
android:textColor="#color/color_black"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/income_amount" />
</android.support.constraint.ConstraintLayout>
I am using chained view in constraint layout. Now I want the intermediate space between two text views to be removed.As the buttons at the bottom are at distance. I am trying to move them from design layout but its not happening as well. How to do it.Following 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"
tools:layout_editor_absoluteY="81dp">
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="23dp"
android:layout_marginStart="32dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="#+id/imageView3"
app:layout_constraintStart_toEndOf="#+id/imageView3" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="26dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView2"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textViewHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="TextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="1dp"
android:layout_marginStart="20dp"
android:layout_marginTop="60dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/linearLayout2">-->
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="25dp"
android:layout_marginStart="16dp"
android:layout_marginTop="70dp"
app:layout_constraintEnd_toStartOf="#+id/textView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="32dp"
android:layout_marginTop="26dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintStart_toEndOf="#+id/imageView2"
app:layout_constraintTop_toTopOf="#+id/imageView2" />
<!-- </LinearLayout>-->
<!-- <LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="1dp"
android:layout_marginStart="20dp"
android:layout_marginTop="60dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="#id/linearLayout"
>-->
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="17dp"
android:layout_gravity="center"
android:layout_marginBottom="58dp"
android:layout_marginEnd="213dp"
android:layout_marginTop="58dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toTopOf="#+id/imageView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/imageView"
app:layout_constraintTop_toBottomOf="#+id/textViewHeader" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="67dp"
android:layout_marginStart="90dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="63dp"
android:layout_marginEnd="89dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textView4" />
<!-- </LinearLayout>-->
</android.support.constraint.ConstraintLayout>
At the bottom there are two text views,placed horizontally and there is space between them. Thanks much :)
To remove space between two chained view, simply add the following line to the first item in the chain:
app:layout_constraintHorizontal_chainStyle="packed"
To read more about chain styles:
Official Android documentation
Medium article
You have to add Guideline
<?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:layout_editor_absoluteY="81dp">
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="23dp"
android:layout_marginStart="32dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="#+id/imageView3"
app:layout_constraintStart_toEndOf="#+id/imageView3" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="26dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView2"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textViewHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="TextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="1dp"
android:layout_marginStart="20dp"
android:layout_marginTop="60dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/linearLayout2">-->
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="25dp"
android:layout_marginStart="16dp"
android:layout_marginTop="70dp"
app:layout_constraintEnd_toStartOf="#+id/textView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="32dp"
android:layout_marginTop="26dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintStart_toEndOf="#+id/imageView2"
app:layout_constraintTop_toTopOf="#+id/imageView2" />
<!-- </LinearLayout>-->
<!-- <LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="1dp"
android:layout_marginStart="20dp"
android:layout_marginTop="60dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="#id/linearLayout"
>-->
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView"
app:srcCompat="#mipmap/ic_launcher_round" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="17dp"
android:layout_gravity="center"
android:layout_marginBottom="58dp"
android:layout_marginEnd="213dp"
android:layout_marginTop="58dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toTopOf="#+id/imageView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/imageView"
app:layout_constraintTop_toBottomOf="#+id/textViewHeader" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="67dp"
android:gravity="center"
app:layout_constraintEnd_toStartOf="#+id/guideline1"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="63dp"
android:gravity="center"
android:text="TextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#+id/guideline1" />
<android.support.constraint.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/guideline1"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<!-- </LinearLayout>-->
</android.support.constraint.ConstraintLayout>
About Guideline in ConstraintLayout:
Utility class representing a Guideline helper object for ConstraintLayout. Helper objects are not displayed on device (they are marked as View.GONE) and are only used for layout purposes. They only work within a ConstraintLayout. [...]
For more details, there is good documentation:
https://developer.android.com/reference/android/support/constraint/Guideline.html
Currently , I have a layout using the constraintLayout like the following
As you see, I divide the checkbox in each section with 10% width using vertical guideline. However, the total of the checkedboxs will be changed due to the user request. That's mean it may show 4 or 3 checkbox in one row.
At this moment, I want to divide the width with weight rather than setting the hard-code percentage. What I should do for this?
Appreciate any comment or advices. Thank you
<?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="wrap_content"
android:background="#color/worklist_normal_row_bg">
<TextView
android:id="#+id/textView97"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginLeft="8dp" />
<TextView
android:id="#+id/textView102"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginStart="8dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView97"
android:layout_marginLeft="8dp" />
<TextView
android:id="#+id/textView103"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
app:layout_constraintStart_toEndOf="#+id/textView102"
app:layout_constraintTop_toTopOf="#+id/textView97"/>
<TextView
android:id="#+id/textView104"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="TextView"
android:textSize="14sp"
app:layout_constraintBaseline_toBaselineOf="#+id/textView102"
app:layout_constraintStart_toStartOf="#+id/guideline12"
android:layout_marginLeft="8dp" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text=" "
app:layout_constraintBaseline_toBaselineOf="#+id/textView103"
app:layout_constraintStart_toStartOf="#+id/guideline12"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintBaseline_toBaselineOf="#+id/checkBox2"
app:layout_constraintStart_toEndOf="#+id/checkBox2"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintBaseline_toBaselineOf="#+id/checkBox4"
app:layout_constraintStart_toEndOf="#+id/checkBox4"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintBaseline_toBaselineOf="#+id/checkBox5"
app:layout_constraintStart_toEndOf="#+id/checkBox5"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintBaseline_toBaselineOf="#+id/checkBox6"
app:layout_constraintStart_toEndOf="#+id/checkBox6"
tools:checked="true" />
<TextView
android:id="#+id/textView105"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="#color/worklist_divider_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView104" />
<android.support.constraint.Guideline
android:id="#+id/guideline11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.3" />
<android.support.constraint.Guideline
android:id="#+id/guideline12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
</android.support.constraint.ConstraintLayout>
Try 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="wrap_content"
android:background="#color/color_bg_rcl">
<TextView
android:id="#+id/textView97"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/textView102"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:text="TextView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView97" />
<TextView
android:id="#+id/textView103"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
app:layout_constraintStart_toEndOf="#+id/textView102"
app:layout_constraintTop_toTopOf="#+id/textView97" />
<TextView
android:id="#+id/textView104"
style="#style/label_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="TextView"
android:textSize="14sp"
app:layout_constraintBaseline_toBaselineOf="#+id/textView102"
app:layout_constraintStart_toStartOf="#+id/guideline12" />
<CheckBox
android:id="#+id/checkBox2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintLeft_toRightOf="#+id/guideline12"
app:layout_constraintRight_toLeftOf="#+id/checkBox4"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintLeft_toRightOf="#+id/checkBox2"
app:layout_constraintRight_toLeftOf="#+id/checkBox5"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintLeft_toRightOf="#+id/checkBox4"
app:layout_constraintRight_toLeftOf="#+id/checkBox6"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintLeft_toRightOf="#+id/checkBox5"
app:layout_constraintRight_toLeftOf="#+id/checkBox7"
tools:checked="true" />
<CheckBox
android:id="#+id/checkBox7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" "
app:layout_constraintLeft_toRightOf="#+id/checkBox6"
app:layout_constraintRight_toRightOf="parent"
tools:checked="true" />
<TextView
android:id="#+id/textView105"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginTop="8dp"
android:background="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView104" />
<android.support.constraint.Guideline
android:id="#+id/guideline11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="108dp" />
<android.support.constraint.Guideline
android:id="#+id/guideline12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
</android.support.constraint.ConstraintLayout>