Adevelopment Adevelopment - 1 year ago 100
Android Question

How to draw Horizontal line between two Linar layout in android

enter image description here

this is my Current screen :

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_margin="5dp"
android:background="@drawable/radial_gradient">

<LinearLayout
android:id="@+id/layout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<com.cognistrength.caregiver.cogniutils.CSTextView
android:id="@+id/button"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="right"
android:layout_marginRight="34dp"
android:layout_marginTop="18dp"
android:layout_marginLeft="28dp"
android:background="@drawable/purple_circular_layout"
android:gravity="center"
android:text="1"
android:textColor="@color/milk_white"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/milk_white"
android:text="Profile"
android:layout_gravity="center"/>
</LinearLayout>

<LinearLayout
android:id="@+id/layout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/layout1"
android:orientation="vertical">

<com.cognistrength.caregiver.cogniutils.CSTextView
android:id="@+id/button2"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="right"
android:layout_marginRight="34dp"
android:layout_marginTop="18dp"
android:layout_marginLeft="28dp"
android:background="@drawable/purple_circular_layout"
android:gravity="center"
android:text="2"
android:textColor="@color/milk_white"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/milk_white"
android:text="Familly"
android:layout_gravity="center"/>
</LinearLayout>


<LinearLayout
android:id="@+id/layout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/layout2"
android:orientation="vertical">

<com.cognistrength.caregiver.cogniutils.CSTextView
android:id="@+id/button3"
android:layout_width="60dp"
android:layout_height="45dp"
android:layout_gravity="right"
android:layout_marginRight="34dp"
android:layout_marginTop="18dp"
android:layout_marginLeft="28dp"
android:background="@drawable/purple_circular_layout"
android:gravity="center"
android:text="3"
android:textColor="@color/milk_white"
android:textSize="12sp"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/milk_white"
android:text="Health Record"
android:layout_gravity="center"/>
</LinearLayout>

</RelativeLayout>


using this xml i am able plot 3 circular text-view inside relative layout i want to plot horizontal line between one and two and two and three text-view as given Screen below please suggest me how to achieve this i am trying to apply view but not able to set eject below screen .

enter image description here

Answer Source

You can implement view between both the layout

<View
    android:id="@+id/view_firstName"
    android:layout_width="match_parent"
    android:layout_height="2dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:background="@color/hintcolor"

    />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download