I am trying to use the Constraint Layout inside a Fragment for my application. The problem, as you can see from the pictures below, is that no matter what I do, the layout seems to be starting halfway through the screen.
This is my code for fragment_progress.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:layout_height="wrap_content"
android:layout_gravity="start"
android:background="#color/app_purple"
android:textAllCaps="false"
tools:context=".ProgressFragment">
<TextView
android:id="#+id/fg_progress_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:text="Your Progress"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="34sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/fg_progress_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginTop="32dp"
android:text="Current Goal: "
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_title" />
<EditText
android:id="#+id/fg_progress_header2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="50dp"
android:text=""
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/fg_progress_header"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_title" />
<TextView
android:id="#+id/fg_progress_goalprogress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="50dp"
android:text="Goal Progress:"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_header" />
<EditText
android:id="#+id/fg_progress_points"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:text=""
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_goalprogress" />
<TextView
android:id="#+id/fg_progress_points2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
android:text="Points"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/fg_progress_points"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_goalprogress" />
<ProgressBar
android:id="#+id/fg_progress_bar"
style="#android:style/Widget.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_points" />
<TextView
android:id="#+id/fg_progress_awardstitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="50dp"
android:text="Awards Unlocked:"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_bar" />
<EditText
android:id="#+id/fg_progress_award1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text=""
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_awardstitle" />
<TextView
android:id="#+id/fg_progress_badgestitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="50dp"
android:text="Badges Obtained:"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_award1" />
<EditText
android:id="#+id/fg_progress_badge1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text=""
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_badgestitle" />
<TextView
android:id="#+id/fg_progress_whotitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="50dp"
android:text="The World Health Organization Recommends:"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_badge1" />
<TextView
android:id="#+id/fg_progress_whoheader1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="Know that it is okay to feel how you are feeling."
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whotitle" />
<TextView
android:id="#+id/fg_progress_whocontent1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text="It is normal during this crazy time to experience feelings of sadness, anger frustration, stress, or all of the above. You are allowed to feel this way and to communicate with others how you are feeling."
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whoheader1" />
<TextView
android:id="#+id/fg_progress_whoheader2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="Maintain a routine."
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whocontent1" />
<TextView
android:id="#+id/fg_progress_whocontent2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text="Start your day at about the same time each day. Set a goal for coursework to be completed for each morning and afternoon. Maintain adequate nutrition by eating three healthy meals per day. Try to get in at least one physical activity each day."
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whoheader2" />
<TextView
android:id="#+id/fg_progress_whoheader3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="Practice good sleep hygiene."
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whocontent2" />
<TextView
android:id="#+id/fg_progress_whocontent3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text="Maintain a consistent sleep schedule. The goal should be 7-9 hours per night. Limit screen time in the evening, and avoid caffeine starting in the afternoon."
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whoheader3" />
<TextView
android:id="#+id/fg_progress_whoheader4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="Connect with others."
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whocontent3" />
<TextView
android:id="#+id/fg_progress_whocontent4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text="It is easy to quickly feel lonely and secluded from others during this stay-at-home period. Make an effort to stay socially connected by engaging in regular video or phone calls with friends and family."
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whoheader4" />
<TextView
android:id="#+id/fg_progress_whoheader5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="Take a break."
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whocontent4" />
<TextView
android:id="#+id/fg_progress_whocontent5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:text="Take time for yourself each day. Step away from the news and from your coursework to do something you enjoy and that you find relaxing or rejuvenating."
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whoheader5" />
<TextView
android:id="#+id/fg_progress_fblink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="8dp"
android:text="(https://www.facebook.com/coronavirus_info/core_tips)"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fg_progress_whocontent5" />
</androidx.constraintlayout.widget.ConstraintLayout>
It used to contain a FrameLayout and a ScrollView, but I removed them to simplify the code because they were not helping. These are two pictures of how the phone screen should look like and how it really looks:
(Please ignore the Action Bar and the Bottom Navigation Menu)
Android Studio
Phone
I've literally tried everything, from switching match_parent to wrap_content, setting margins on the elements or the layout itself, changing the gravity, etc. The only thing that worked is setting a negative bottom margin of -800dp to the Constraint Layout, but that breaks the scrolling functionality, and adding a ScrollView does not help. I have no idea why this is happening. I just need the first TextView to go to the top of the screen. Everything else is properly constrained so they'll follow.
Any ideas?
Thanks in advance!
The problem here is not with the XML code of the fragment but with the host activity layout file.
Since you are hosting the fragments for the bottom navigation in an activity, if you check the XML code it might be the case that you would find that it has android:paddingTop="?attr/actionBarSize" this code in the parent view of the activity.
Remove the padding and it works fine.
Related
I have a textview between 2 other views inside a ConstraintLayout.
I set the text of the second one in the onViewCreated of my Fragment and later change it after some user input.
The first text works fine, but when i change it later i would expect its size to change with it, which of course would cause the view on its right to move a bit.
Instead the new text breaks down into 2 lines, when it's longer than the original...
How can i achieve that?
Here are the 3 Views:
<TextView
android:id="#+id/label"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:fontFamily="#font/hevetica_font"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="#string/lbl"
android:textColor="#color/FlatWhite"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/topView" />
<TextView
android:id="#+id/text"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:fontFamily="#font/hevetica_font"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text=""
android:textColor="#color/FlatWhite"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="#id/label"
app:layout_constraintTop_toBottomOf="#id/topView" />
<Button
android:id="#+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
app:layout_constraintStart_toEndOf="#id/label"
app:layout_constraintTop_toBottomOf="#id/topView"
android:text="change"
/>
and in the java code i change text using textView.setText(text);
If I understood you correctly, you want the text in the second view not to be split into 2 lines, you need to make the following changes:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView
android:id="#+id/label"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/text"
android:layout_width="0dp"
android:layout_height="35dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="24dp"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:maxLines="1"
android:textSize="19sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="#id/label"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
app:layout_constraintStart_toEndOf="#id/text"
app:layout_constraintTop_toTopOf="parent"
android:text="change" />
</androidx.constraintlayout.widget.ConstraintLayout>
I am stuck with ConstraintLayout and confused to use which property to do as I want.
As per the following image, I wanted to give top-constraint of Details to either TextView of OrderTakenBy or OrderCollectedBy as per the height of that view.
Scenario:
If I give top constraint of Detail view as the bottom of OrderTakenBy TextView, It will overlap (as below image) the view of OrderCollectedBy Textview if it gets more lines. Vice versa.
Note: Order Taken By or Order Collected By may contain two or three lines.
So what can I do for top constraints which can work for both dynamic heights?
Edited:
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.AccountMasterAddActivity"
tools:showIn="#layout/activity_account_master_add">
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:text="#string/hint_order_no"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toStartOf="#+id/guideline"
app:layout_constraintStart_toStartOf="#+id/supplierNameTextView"
app:layout_constraintTop_toBottomOf="#+id/supplierNameTextView" />
<TextView
android:id="#+id/orderNoTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView2"
app:layout_constraintStart_toStartOf="#+id/textView2"
app:layout_constraintTop_toBottomOf="#+id/textView2"
tools:text="TextView" />
<TextView
android:id="#+id/textView4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="#string/hint_supplier_name"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/supplierNameTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView4"
app:layout_constraintStart_toStartOf="#+id/textView4"
app:layout_constraintTop_toBottomOf="#+id/textView4"
tools:text="TextView" />
<TextView
android:id="#+id/textView6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:gravity="end"
android:text="#string/hint_order_date"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toEndOf="#+id/supplierNameTextView"
app:layout_constraintStart_toStartOf="#+id/guideline"
app:layout_constraintTop_toTopOf="#+id/textView2" />
<TextView
android:id="#+id/orderDateTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:gravity="end"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView6"
app:layout_constraintStart_toStartOf="#+id/textView6"
app:layout_constraintTop_toBottomOf="#+id/textView6"
tools:text="TextView" />
<TextView
android:id="#+id/textView8"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:text="#string/hint_order_taken_by"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toStartOf="#+id/guideline"
app:layout_constraintStart_toStartOf="#+id/orderNoTextView"
app:layout_constraintTop_toBottomOf="#+id/orderNoTextView" />
<TextView
android:id="#+id/orderTakenByTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="TextView TextView"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView8"
app:layout_constraintStart_toStartOf="#+id/textView8"
app:layout_constraintTop_toBottomOf="#+id/textView8" />
<TextView
android:id="#+id/textView10"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:text="#string/hint_order_collected_by"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toEndOf="#+id/orderDateTextView"
app:layout_constraintStart_toStartOf="#+id/orderDateTextView"
app:layout_constraintTop_toTopOf="#+id/textView8" />
<TextView
android:id="#+id/orderCollectedByTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:gravity="end"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView10"
app:layout_constraintStart_toStartOf="#+id/textView10"
app:layout_constraintTop_toBottomOf="#+id/textView10"
tools:text="TextView TextView TextView TextView TextView" />
<TextView
android:id="#+id/textView12"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#string/hint_details"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toEndOf="#+id/orderCollectedByTextView"
app:layout_constraintStart_toStartOf="#+id/orderTakenByTextView"
app:layout_constraintTop_toBottomOf="#+id/orderCollectedByTextView" />
<TextView
android:id="#+id/detailsTextView"
style="#style/TextAppearance.AppCompat.Medium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:autoLink="phone"
android:textColor="#color/colorPrimary"
app:layout_constraintEnd_toEndOf="#+id/textView12"
app:layout_constraintStart_toStartOf="#+id/textView12"
app:layout_constraintTop_toBottomOf="#+id/textView12"
tools:text="TextView" />
<TextView
android:id="#+id/productLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Products"
android:textColor="#color/colorAccent"
app:layout_constraintEnd_toEndOf="#+id/detailsTextView"
app:layout_constraintStart_toStartOf="#+id/detailsTextView"
app:layout_constraintTop_toBottomOf="#+id/detailsTextView" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintGuide_percent="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/productLabel"
app:layout_constraintStart_toStartOf="#+id/productLabel"
app:layout_constraintTop_toBottomOf="#+id/productLabel" />
</androidx.constraintlayout.widget.ConstraintLayout>
Anyone can help?
You can use the Barrier To overcome this issue.
A Barrier references multiple widgets as input, and creates a virtual guideline based on the most extreme widget on the specified side. For example, a left barrier will align to the left of all the referenced views.
Here is the Documentation for Barrier
Add Order Taken By or Order Collected By as app:constraint_referenced_ids="view1,view2" and set the Detail view top to the bottom of the Barrie.
XML Reference:
<androidx.constraintlayout.widget.Barrier
android:id="#+id/barrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="411dp"
app:barrierDirection="bottom"
app:constraint_referenced_ids="order_taken_by,order_collected_by"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="21dp"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/detail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="New"
android:textSize="#dimen/_16sp"
app:layout_constraintTop_toBottomOf="#+id/barrier"/>
Here is the output:
Use bottom barrier
Use Deatils textview top constraint to barrier and barrier reference to OrderTakenBy, OrderCollectedBy textview.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/OrderTakenBy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="warehouse sdgjklsdj jgkjskg"
app:layout_constraintEnd_toStartOf="#+id/OrderCollectedBy"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/OrderCollectedBy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="hospital fhkhsf "
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/OrderTakenBy"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Barrier
android:id="#+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="OrderCollectedBy, OrderTakenBy" />
<TextView
android:id="#+id/Details"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:text="lorem_ipsum"
android:gravity="center"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/barrier" />
</androidx.constraintlayout.widget.ConstraintLayout>
I think you can wrap order taken by and order collected by in another constraint layout or to check programmatically the height(after setting the text) of the TextView's and change programmatically the top constraint.
I've been struggling with this for days now. Its probably possible without constraintLayout to get this done, but i'm would really like it to be done with constraintLayout.
I have 6 views next to eachother. 4 on the left side, 2 on the right, but at the same height.
Those 2 on the left, they don't change width and they should be on the right always.
Those 4 on the right change sizes and, more important, sometimes not all 4 views wil show up.
I cant chain the six of them of course, because then, if there are only 2 tags on the left side, my 2 views on the right will move to the left.
My best attempt was chaining the 4 views on the left. And chaining the 2 views on the right. That works perfectly fine, except! when there is a larger view on the right, then these 4 views will overlay the 2 views on the right. But, whenever i make a constraint to make sure the 4 views will NOT overlay my right views, android thinks i'm chaining 6 views and i get the problem above.
Well, anyone who knows a fine trick to solve this? Its really a big puzzle for me.
This is how it should look:
How i want it to look (a bit like) so always a margin between the 4th and 5th view.
And here's the code i used:
(i have been struggling though and tried a lot of things like guidelines and barriers, so it's certainly nog yet clean and nice coding)
<TextView
android:id="#+id/distance"
style="#style/helveticaRoman15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingTop="3dp"
android:paddingEnd="5dp"
android:paddingBottom="3dp"
android:textColor="#color/gray"
app:layout_constraintEnd_toStartOf="#+id/freeKm"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="1,7 km" />
<TextView
android:id="#+id/freeKm"
style="#style/helveticaRoman15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:autoSizeTextType="uniform"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:maxLines="1"
android:minWidth="82dp"
android:paddingStart="5dp"
android:paddingTop="3dp"
android:paddingEnd="5dp"
android:paddingBottom="3dp"
android:text="#string/resource_view_free_km"
android:textColor="#color/gray"
app:layout_constraintEnd_toStartOf="#+id/yearOfConstruction"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_weight="3"
app:layout_constraintStart_toEndOf="#+id/distance"
app:layout_constraintTop_toTopOf="#+id/distance"
tools:text="100 vrije km" />
<TextView
android:id="#+id/yearOfConstruction"
style="#style/helveticaRoman15"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:autoSizeTextType="uniform"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:maxLines="1"
android:paddingStart="5dp"
android:paddingTop="3dp"
android:paddingEnd="5dp"
android:paddingBottom="3dp"
android:textColor="#color/gray"
app:layout_constraintEnd_toStartOf="#+id/newIndicator"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_weight="3"
app:layout_constraintStart_toEndOf="#+id/freeKm"
app:layout_constraintTop_toTopOf="#+id/distance"
app:layout_constraintWidth_max="50dp"
tools:text="bouwjaar" />
<TextView
android:id="#+id/newIndicator"
style="#style/helveticaMedium15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="#drawable/bg_gray_car_location"
android:fontFamily="#font/helvetica_neu_bold"
android:gravity="center"
android:paddingStart="5dp"
android:paddingTop="3dp"
android:paddingEnd="5dp"
android:paddingBottom="3dp"
android:text="#string/resource_view_free_km"
android:textColor="#color/black"
app:layout_constraintEnd_toStartOf="#+id/guideline"
app:layout_constraintStart_toEndOf="#+id/yearOfConstruction"
app:layout_constraintTop_toTopOf="#+id/yearOfConstruction"
tools:text="nieuw" />
<android.support.constraint.Barrier
android:id="#+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="start"
app:constraint_referenced_ids="thumbImage, numberOfBookings"
tools:layout_editor_absoluteX="411dp" />
<ImageView
android:id="#+id/thumbImage"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:gravity="center_vertical"
android:src="#drawable/ic_thumb"
android:tint="#color/gray"
app:layout_constraintBottom_toBottomOf="#+id/distance"
app:layout_constraintEnd_toStartOf="#+id/numberOfBookings"
app:layout_constraintStart_toEndOf="#+id/guideline"
app:layout_constraintTop_toTopOf="#+id/distance" />
<TextView
android:id="#+id/numberOfBookings"
style="#style/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="#color/yellow"
android:textSize="#dimen/button_textview"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="#+id/distance"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/thumbImage"
app:layout_constraintTop_toTopOf="#+id/distance"
tools:text="100%" />
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="82dp" />
I actually managed quite a bit now to get what i want. #NikosHidalgo thanks for the suggestion about the barrier/guideline. I'll put my code underneath. Unfortunately i do not jet really understand what i did, but it looks good.... – Titei 6 mins ago
<?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/white"
android:orientation="vertical">
<!--tag1-->
<TextView
android:id="#+id/distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:textColor="#color/gray"
app:layout_constraintBottom_toBottomOf="#+id/freeKm"
app:layout_constraintEnd_toStartOf="#+id/freeKm"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/freeKm"
tools:text="1,7 km" />
<!--tag2-->
<TextView
android:id="#+id/freeKm"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="12dp"
android:autoSizeTextType="uniform"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:maxWidth="95dp"
android:textColor="#color/gray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/yearOfConstruction"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/distance"
app:layout_constraintTop_toTopOf="parent"
tools:text="100 vrije km" />
<!--tag3-->
<TextView
android:id="#+id/yearOfConstruction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:autoSizeTextType="uniform"
android:background="#drawable/bg_gray_car_location"
android:gravity="center"
android:maxLines="1"
android:textColor="#color/gray"
app:layout_constraintTop_toTopOf="#+id/freeKm"
app:layout_constraintBottom_toBottomOf="#+id/freeKm"
app:layout_constraintEnd_toStartOf="#+id/newIndicator"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/freeKm"
tools:text="plaatsnaam" />
<!--tag4-->
<TextView
android:id="#+id/newIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="#drawable/bg_gray_car_location"
android:fontFamily="#font/helvetica_neu_bold"
android:autoSizeTextType="uniform"
android:maxLines="1"
android:text="#string/resource_view_free_km"
android:textColor="#color/black"
app:layout_constraintTop_toTopOf="#+id/freeKm"
app:layout_constraintBottom_toBottomOf="#+id/freeKm"
app:layout_constraintEnd_toStartOf="#+id/guideline"
app:layout_constraintStart_toEndOf="#+id/yearOfConstruction"
tools:text="nieuw" />
<android.support.constraint.Barrier
android:id="#+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="start"
app:constraint_referenced_ids="distance, freeKm, yearOfConstruction, newIndicator"
app:layout_constraintEnd_toStartOf="#+id/thumbImage"
app:layout_constraintStart_toEndOf="#+id/guideline" />
<!--end image-->
<ImageView
android:id="#+id/thumbImage"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:gravity="center_vertical"
android:src="#drawable/ic_thumb_up"
android:tint="#color/gray"
app:layout_constraintBottom_toBottomOf="#+id/distance"
app:layout_constraintEnd_toStartOf="#+id/numberOfBookings"
app:layout_constraintStart_toEndOf="#+id/guideline"
app:layout_constraintTop_toTopOf="#+id/distance" />
<!-- end view-->
<TextView
android:id="#+id/numberOfBookings"
style="#style/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textSize="#dimen/button_textview"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="#+id/freeKm"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/thumbImage"
app:layout_constraintTop_toTopOf="#+id/freeKm"
tools:text="100%" />
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="85dp" />
</android.support.constraint.ConstraintLayout>
I have a problem with the following xml file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/search_list_leaf"
tools:context=".Flowers_List">
<TextView
android:id="#+id/A"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:text="A"
android:textSize="30sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="56dp" />
<TextView
android:id="#+id/B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B"
android:textSize="30sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="112dp" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SEARCH YOUR FLOWER"
android:textColor="#030303"
android:textSize="30sp"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="0dp" />
<TextView
android:id="#+id/C"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="C"
android:textSize="30sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="179dp" />
<TextView
android:id="#+id/D"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="D"
android:textSize="30sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="241dp" />
<TextView
android:id="#+id/E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="E"
android:textSize="30sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="310dp" />
The problem is that, even if I change color with the command android:textColor="#color/colorIwant" I get a default color which is green (don't know why) when I run the application, while I have the right color in the design. Another problem is that even if I place all the letters in order on the design and then I apply contraint, when I launch the application I get all the letters distributed in a messy way.
What do you think the problem is about?
I place all the letters in order on the design and then I apply contraint, when I launch the application I get all the letters distributed in a messy way.
That's because you have not put necessary constraint to child TextViews, but the absolute positions.
I tried to solve this issue, see below 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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/A"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="A"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2" />
<TextView
android:id="#+id/B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="B"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/A" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="SEARCH YOUR FLOWER"
android:textColor="#030303"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/C"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="C"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/B" />
<TextView
android:id="#+id/D"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="D"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/C" />
<TextView
android:id="#+id/E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="E"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/D"
app:layout_constraintVertical_bias="0.0" />
As you can see, each child TextView is now constrained both sides--vertically and horizontally to the parent, that is the rootview-constraintlayout or other child view.
For example, the constraint constraintEnd_toEndOf will align the end of this view to end of another view. Same way, other constraints work and are applied.
You can also give horizontal and vertical bias to position them properly. Hope this helped a little to understand how constraint works.
for order https://stackoverflow.com/a/50855782/7616371 this is correct
and for change textColor you can use :-
android:textColor="#fff"
and for textview background color
android:background="#fff"
Here is how the list card looks in Android Studio's Design view, so far so good:
Here is how it looks on mobile. Note the overlapping of the divider and detail text in the second list card:
What's strange is that the FIRST list card is fine in the mobile view. It also has a very long textview, except the text content is broken up with whitespace.
But the SECOND list card is all messed up and the only difference is the textview content is one long word.
One more exception: having a super long unbroken word in the bottom textview is OK as long as the title textview is short / broken up:
What is going on here? Any help would be appreciated!
Here is the layout xml file for the list card:
<?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:id="#+id/reportListItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#android:drawable/dialog_holo_light_frame">
<TextView
android:id="#+id/titleText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif-medium"
android:textAppearance="#style/TextAppearance.AppCompat.Subhead"
app:layout_constraintLeft_toRightOf="#+id/unreadMarker"
app:layout_constraintRight_toLeftOf="#+id/dangerousMarker"
app:layout_constraintTop_toTopOf="parent"
tools:text="wwwwWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW" />
<ImageView
android:id="#+id/unreadMarker"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginTop="22dp"
android:contentDescription=""
android:cropToPadding="false"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/unread"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent" />
<ImageView
android:id="#+id/dangerousMarker"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="14dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/icon_dangerous" />
<TextView
android:id="#+id/locationText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="41dp"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif"
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
android:textColor="#color/colorText"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/titleText"
tools:text="74 Jeramie Wall Suite 277"
app:layout_constraintRight_toLeftOf="#+id/dangerousMarker"
android:layout_marginRight="8dp"
app:layout_constraintHorizontal_bias="1.0" />
<TextView
android:id="#+id/timeText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginTop="4dp"
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
android:textColor="#color/colorText"
android:textSize="12sp"
app:layout_constraintLeft_toLeftOf="#+id/locationText"
app:layout_constraintTop_toBottomOf="#+id/locationText"
tools:text="01:18 PM"
android:layout_marginRight="0dp"
app:layout_constraintRight_toRightOf="#+id/locationText"
app:layout_constraintHorizontal_bias="0.0" />
<ImageView
android:id="#+id/locationMarker"
android:layout_width="0dp"
android:layout_height="14dp"
android:layout_marginBottom="0dp"
android:layout_marginRight="5dp"
android:layout_marginTop="0dp"
app:layout_constraintBottom_toBottomOf="#+id/locationText"
app:layout_constraintRight_toLeftOf="#+id/locationText"
app:layout_constraintTop_toTopOf="#+id/locationText"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="#drawable/pin_small" />
<ImageView
android:id="#+id/timeMarker"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginBottom="0dp"
android:layout_marginRight="5dp"
android:layout_marginTop="0dp"
app:layout_constraintBottom_toBottomOf="#+id/timeText"
app:layout_constraintRight_toLeftOf="#+id/timeText"
app:layout_constraintTop_toTopOf="#+id/timeText"
app:srcCompat="#drawable/clock_small" />
<View
android:id="#+id/divider"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginRight="24dp"
android:layout_marginLeft="24dp"
android:layout_marginTop="16dp"
android:background="#color/colorDivider"
android:visibility="visible"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/timeText" />
<TextView
android:id="#+id/detailsText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:layout_marginTop="8dp"
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
android:textColor="#color/colorText"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/divider"
tools:text="I was jhots. No screams be careful. too many details to explain come with me if you want to live take this gun the terminator is co\n\n\n\n\nming" />
</android.support.constraint.ConstraintLayout>