Skip to content

Instantly share code, notes, and snippets.

@guuilp
Created June 28, 2018 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guuilp/5c9904d61f91fc70d7067d1c8ead7f3e to your computer and use it in GitHub Desktop.
Save guuilp/5c9904d61f91fc70d7067d1c8ead7f3e to your computer and use it in GitHub Desktop.
Constraint Layout DOJO - Solution (STEP 1)
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/profile_image"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:src="@drawable/profile_image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<TextView
android:id="@+id/text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
tools:text="You found a bug in Android/Jetpacksuetracker.google.com so the teams know about it. Complaining on Twitter won't get that bug fixed."
android:textColor="@color/white"
app:layout_constraintTop_toBottomOf="@+id/username"
app:layout_constraintLeft_toLeftOf="@+id/username"
app:layout_constraintRight_toRightOf="parent"/>
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
tools:text="Florina Muntenescu"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@+id/profile_image"
app:layout_constraintLeft_toRightOf="@+id/profile_image"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment