I would like to create a layout for a simple two line list item according to the Material Design specification for a list component. See https://material.io/components/lists/#specs I'm trying to create the first item in the two line specification.
I could align the bottom of the first TextView 28dp to the top, probably with a ConstraintLayout and a Guideline. Same thing for the secondary TextView with 20dp to the bottom of the first TextView.
The problem is that the TextViews should be aligned with the baseline and not the bottom of the view and I don't know how to achieve this.
I've tried using a ConstraintLayout with a Guideline and app:layout_constraintBaseline_toBaselineOf in the TextView to the Guideline but as I understand it this should not work as a Guideline does not have a baseline.
A simple ConstraintLayout with two TextViews that should be aligned with the baselines:
<?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="64dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?textAppearanceSubtitle1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?textAppearanceCaption"
/>
</androidx.constraintlayout.widget.ConstraintLayout>