0

In the image below I have two users, How do I reduce the bottom length stroke so that it only starts from "second, first".

Image of current stroke

<item>
    <shape android:shape="rectangle" >
        <solid android:color="#fff" />

    </shape>
</item>

<item android:top="-2dp" android:right="-2dp" android:left="-2dp">
    <shape>

        <solid android:color="@android:color/transparent"  />
        <stroke
            android:width="0.1dp"
            android:color="#ababb2"/>
    </shape>
</item>

This is the full xml. Here I have a Relative layout comprising of all the textview, and imageviews. The relative view is containing the background with the drawable shape file above.

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/singleuserlist"
    android:layout_width="match_parent"
    android:background="@drawable/my_shape_file"
    android:layout_height="wrap_content"
    android:layout_marginBottom="5dp">
    <ImageView
        android:id="@+id/imageview_post_userimage1"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_marginRight="10dp"
        android:paddingRight="10dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true" />
    <TextView
        android:id="@+id/username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Default Name"
        android:textAlignment="center"
        android:textSize="18sp"
        android:textStyle="bold"
        android:textColor="#191919"

        android:layout_toEndOf="@+id/imageview_post_userimage1" />

    <TextView
        android:id="@+id/userstatus4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignStart="@+id/username"
        android:layout_below="@+id/username"
        android:layout_marginTop="8dp"
        android:text="Default Status"
        android:textAlignment="center"
        android:textSize="15sp" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="12dp"
      android:layout_marginTop="7dp"
        android:layout_height="12dp"
        android:layout_marginLeft="8dp"
        android:visibility="invisible"
        android:background="@drawable/online_circle"
        android:orientation="horizontal"
        android:layout_alignParentTop="true"
        android:layout_toEndOf="@+id/username"
     />

    <TextView
        android:id="@+id/badge_notification_1"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:background="@drawable/circle_bg"
        android:gravity="center"
        android:text="50"
        android:textColor="#fff"
        android:padding="0sp"
        android:textSize="13sp"
        android:textStyle="bold"
        android:layout_marginEnd="21dp"
        android:visibility="invisible"
        android:layout_alignTop="@+id/userstatus4"
        android:layout_alignParentEnd="true" />

</RelativeLayout>
  • Hard to understand the question. I cant even see what is the button from that feature? which one is textview? – Xenolion Oct 02 '17 at 14:21
  • This is the background of my relative layout. All its doing is producing that line on the bottom for each user. And I would like to reduce the length of the line. – David Bowen Oct 02 '17 at 14:28
  • Can you post your relative layout xml here? – Suhayl SH Oct 02 '17 at 14:34
  • Why don't you just split your relative layout into image view and another relative layout on the right and set the background to only the right one instead of the whole view! – Xenolion Oct 02 '17 at 14:39
  • The xml. It is just a relativelayout using the background above drawable. Comprising of textviews and imageviews. – David Bowen Oct 02 '17 at 14:39
  • I just tried using another relativelayout, its still going accross. any ideas? – David Bowen Oct 02 '17 at 14:51

1 Answers1

1

You can change your layout to something like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/singleuserlist"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizantal">

    <ImageView
        android:id="@+id/imageview_post_userimage1"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="10dp"
        android:paddingRight="10dp" />

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/relativeLayout"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_marginBottom="5dp"
        android:background="@drawable/background">

        <TextView
            android:id="@+id/username"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@+id/imageview_post_userimage1"
            android:text="Default Name"
            android:textAlignment="center"
            android:textColor="#191919"
            android:textSize="18sp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/userstatus4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignStart="@+id/username"
            android:layout_below="@+id/username"
            android:layout_marginTop="8dp"
            android:text="Default Status"
            android:textAlignment="center"
            android:textSize="15sp" />

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="12dp"
            android:layout_height="12dp"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="8dp"
            android:layout_marginTop="7dp"
            android:layout_toEndOf="@+id/username"
            android:background="@drawable/online_circle"
            android:orientation="horizontal"
            android:visibility="invisible" />

        <TextView
            android:id="@+id/badge_notification_1"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:layout_alignParentEnd="true"
            android:layout_alignTop="@+id/userstatus4"
            android:layout_marginEnd="21dp"
            android:background="@drawable/circle_bg"
            android:gravity="center"
            android:padding="0sp"
            android:text="50"
            android:textColor="#fff"
            android:textSize="13sp"
            android:textStyle="bold"
            android:visibility="invisible" />

    </RelativeLayout>
</LinearLayout>
Suhayl SH
  • 1,213
  • 1
  • 11
  • 16