title: how to create a border around constraint layout along with an option for title
body: <p>I need to achieve the style like below</p>
  <p><a href="https://i.stack.imgur.com/LBTZy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LBTZy.png" alt="enter image description here" /></a></p>
  <p>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.</p>
  <p>Now I know how to give border around constraint layout using below code</p>
  <pre><code>&lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:shape=&quot;rectangle&quot;&gt;
      &lt;solid android:color=&quot;@android:color/transparent&quot; /&gt;
      &lt;stroke
          android:width=&quot;1dp&quot;
          android:color=&quot;#6B000000&quot; /&gt;
  
      &lt;corners android:radius=&quot;4dp&quot; /&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>But, I'm not getting how to set title like in above image.</p>
  <p>I tried to put textview with negative margin/padding like below, But it didn't work</p>
  <pre><code>&lt;TextView
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;#00000000&quot;
              android:fontFamily=&quot;sans-serif&quot;
              android:text=&quot;@string/title&quot;
              android:textColor=&quot;@color/logoDark&quot;
              android:textCursorDrawable=&quot;@drawable/cursor_style&quot;
              android:textSize=&quot;12sp&quot;
              android:paddingTop=&quot;-20dp&quot;
              app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;
  </code></pre>