Skip to content

Instantly share code, notes, and snippets.

@Sethathi
Created March 23, 2022 06:27
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 Sethathi/e39b984dfe0a7b5fcc8f6026d115e213 to your computer and use it in GitHub Desktop.
Save Sethathi/e39b984dfe0a7b5fcc8f6026d115e213 to your computer and use it in GitHub Desktop.
<!-- What's wrong with this layout, how can it be improve? -->
<?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">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/fullnameLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/renter_avatar"
android:layout_width="72dp"
android:layout_height="72dp"
android:background="@drawable/avatar_white_stroke"
android:padding="1dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_avatar_default_circle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="100"
android:text="FirstName" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="100"
android:text="LastName" />
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="1 Main Road, Street name, City, Country "
app:layout_constraintTop_toBottomOf="@+id/fullnameLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment