My objective is to create a layout where there is a line , a text immediately after that and a line for the remaining space horizontally. I am trying to do it with view> textview>view with weights , but the textview doesn't seem to cover the space at start and end. So how to remove that space ? Here is my code
<LinearLayout
android:layout_width="match_parent"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:orientation="horizontal"
android:layout_weight="0.01"
android:gravity="center"
android:layout_height="wrap_content">
<View
android:layout_width="0dp"
android:layout_weight="0.2"
android:layout_height="2dp"
android:background="#000000"/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:text="DELIVERED"
android:textSize="16sp"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/black"
android:fontFamily="@font/roboto_regular"
android:layout_weight="0.3"
android:layout_height="wrap_content"/>
<View
android:layout_width="0dp"
android:layout_weight="0.5"
android:layout_height="2dp"
android:background="#000000"/>
</LinearLayout>
As you can see there is space before and after delivered.
Thanks :)
