Skip to content

Instantly share code, notes, and snippets.

@brownsoo
Created June 19, 2017 05:38
Show Gist options
  • Save brownsoo/468c6a8e7caba21cf767c31961410c57 to your computer and use it in GitHub Desktop.
Save brownsoo/468c6a8e7caba21cf767c31961410c57 to your computer and use it in GitHub Desktop.
chat style layout - resizable left child view with following right child view
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- left wrap_content view is resizable but not exceeds following child view -->
<TextView
android:id="@+id/parcel_number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="@string/vt__font_family_light"
android:textColor="@color/vt__shipment__process__order__parcel__number"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/feature_container"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_default="wrap"
tools:text="1234-1234-123441234-123441234-123441234-12344"
/>
<!-- following child view that is also has wrap_content -->
<LinearLayout
android:id="@+id/feature_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/parcel_number"/>
</android.support.constraint.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment