I need to achieve the style like below
but, I have a constraint layout inside which so many sub layouts I have, which resembles a edit text view with feature like editing particular set of values by locking editing of other values.
Now I know how to give border around constraint layout using below code
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="#6B000000" />
<corners android:radius="4dp" />
</shape>
But, I'm not getting how to set title like in above image.
I tried to put textview with negative margin/padding like below, But it didn't work
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:fontFamily="sans-serif"
android:text="@string/title"
android:textColor="@color/logoDark"
android:textCursorDrawable="@drawable/cursor_style"
android:textSize="12sp"
android:paddingTop="-20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

