Thursday 28 February 2019

prominence of card view layout and divider color

I used CardView layout in list_item.xml "the xml post cell" for RecyclerView", I trying to making the cards prominenced and the color of divider close to gray like this

But it appears as like there is no emergence or color of it,
this image for current situation

this post_item.xml

   <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_margin="5dp"
    android:elevation="6dp"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical"
            android:padding="10dp">

            <TextView
                android:id="@+id/postTitle"
                style="@style/Base.TextAppearance.AppCompat.Title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="5dp"
                android:layout_marginRight="5dp"
                android:ellipsize="end"
                android:maxLines="2"
                android:text="This is the post title,
you can check bla bla bla bla bla lkjdflkjhnfldkjhnflkjhnlfkjnglkjnlkjkln" />

            <TextView
                android:id="@+id/postDescription"
                style="@style/Base.TextAppearance.AppCompat.Body2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="5dp"
                android:layout_marginEnd="5dp"
                android:layout_marginRight="5dp"
                android:ellipsize="end"
                android:maxLines="4"
                android:text="This is the post titldfkjfdjffkjdhfnkjdsfjnkdsjnksskskjfnksjfnksjfnksjfnkjdfbdnfbjvb jkxzbvkjxcvbvkjve,
you can check bla bla bla bla bla lkjdflkjhnfldkjhnflkjhnlfkjnglkjnlkjkln" />

        </LinearLayout>

        <ImageView
            android:id="@+id/postImage"
            android:layout_width="match_parent"
            android:layout_height="125dp"
            android:layout_marginEnd="5dp"
            android:layout_marginRight="5dp"
            android:layout_weight="3"
            android:adjustViewBounds="true"
            android:src="@mipmap/ic_launcher" />


    </LinearLayout>

</android.support.v7.widget.CardView>

I tried to solve the problem by adding this two lines on RecyclerView like this answer but it did not work
android:divider="#E6E6E6" android:dividerHeight="0px"



from prominence of card view layout and divider color

No comments:

Post a Comment