<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bineesh P Babu on Medium]]></title>
        <description><![CDATA[Stories by Bineesh P Babu on Medium]]></description>
        <link>https://medium.com/@Bineeshpbabu?source=rss-9ed54b66137------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ifWle07FWoWhV2vy4C2AEg.jpeg</url>
            <title>Stories by Bineesh P Babu on Medium</title>
            <link>https://medium.com/@Bineeshpbabu?source=rss-9ed54b66137------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:40:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Bineeshpbabu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MultiView Recyclerview]]></title>
            <link>https://medium.com/@Bineeshpbabu/multiview-recyclerview-df7eeeea9031?source=rss-9ed54b66137------2</link>
            <guid isPermaLink="false">https://medium.com/p/df7eeeea9031</guid>
            <category><![CDATA[listview]]></category>
            <category><![CDATA[recyclerview]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[multiview]]></category>
            <dc:creator><![CDATA[Bineesh P Babu]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 08:54:31 GMT</pubDate>
            <atom:updated>2018-11-15T10:01:27.696Z</atom:updated>
            <content:encoded><![CDATA[<h3>TimeLine App Design using MultiView Recyclerview</h3><p>The <strong>RecyclerView</strong> class is a more advanced and flexible version of ListView. In this project, multiview recyclerview is used to achieve a good timeline design for a mobile application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*YsiVHctUiOCzP5YC51qt3A.gif" /><figcaption>TimeLine Design</figcaption></figure><h3>Components for MultiView</h3><ol><li>RecyclerView</li><li>Data</li><li>LayoutManager</li><li>Adapter</li><li>ViewHolders</li><li>Layout items(items for listing)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZTWlEHekM2GqXRABJFIvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjMSuwHLUqH8pQnAnDPqjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*babREdFzebg7whQwmpfrjg.png" /></figure><h4>activity_time_line.xml</h4><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    tools:context=&quot;.TimeLineActivity&quot;&gt;<br>    &lt;android.support.v7.widget.RecyclerView<br>        android:id=&quot;@+id/rv&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;<br>    &lt;/android.support.v7.widget.RecyclerView&gt;<br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><h4>item_card_type_start.xml</h4><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;270dp&quot;&gt;<br><br>        &lt;LinearLayout<br>            android:id=&quot;@+id/linearLayout4&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:layout_marginStart=&quot;24dp&quot;<br>            android:layout_marginLeft=&quot;24dp&quot;<br>            android:layout_marginTop=&quot;8dp&quot;<br>            android:layout_marginBottom=&quot;8dp&quot;<br>            android:orientation=&quot;vertical&quot;<br>            app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>            app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>            app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;<br><br>            &lt;TextView<br>                android:id=&quot;@+id/monthPurchased&quot;<br>                android:layout_width=&quot;wrap_content&quot;<br>                android:layout_height=&quot;wrap_content&quot;<br>                android:text=&quot;AUG&quot;<br>                android:textColor=&quot;#757575&quot; /&gt;<br><br>            &lt;TextView<br>                android:id=&quot;@+id/yearPurchased&quot;<br>                android:layout_width=&quot;wrap_content&quot;<br>                android:layout_height=&quot;wrap_content&quot;<br>                android:layout_marginTop=&quot;4dp&quot;<br>                android:text=&quot;2018&quot;<br>                android:textColor=&quot;#444444&quot; /&gt;<br>        &lt;/LinearLayout&gt;<br><br>    &lt;ImageView<br>        android:id=&quot;@+id/imageView4&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;16dp&quot;<br>        android:layout_marginLeft=&quot;16dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/ic_circle_shape&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/linearLayout4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:layout_width=&quot;4dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/imageView4&quot; /&gt;<br><br>    &lt;de.hdodenhof.circleimageview.CircleImageView<br>        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>        android:id=&quot;@+id/dealProductImage&quot;<br>        android:layout_width=&quot;150dp&quot;<br>        android:layout_height=&quot;150dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;32dp&quot;<br>        android:layout_marginRight=&quot;32dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/samsung&quot;<br>        app:civ_border_color=&quot;#cccccc&quot;<br>        app:civ_border_width=&quot;4dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:id=&quot;@+id/view5&quot;<br>        android:layout_width=&quot;0dp&quot;<br>        android:layout_height=&quot;4dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/textView32&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;16sp&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/productPrice&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;20sp&quot;<br>        android:textStyle=&quot;bold&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/textView32&quot; /&gt;<br><br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><h4>item__card_type_middle.xml</h4><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;270dp&quot;&gt;<br><br>    &lt;LinearLayout<br>        android:id=&quot;@+id/linearLayout4&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;24dp&quot;<br>        android:layout_marginLeft=&quot;24dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;<br><br>        &lt;TextView<br>            android:id=&quot;@+id/monthPurchased&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:text=&quot;AUG&quot;<br>            android:textColor=&quot;#757575&quot; /&gt;<br><br>        &lt;TextView<br>            android:id=&quot;@+id/yearPurchased&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:layout_marginTop=&quot;4dp&quot;<br>            android:text=&quot;2018&quot;<br>            android:textColor=&quot;#444444&quot; /&gt;<br>    &lt;/LinearLayout&gt;<br><br>    &lt;ImageView<br>        android:id=&quot;@+id/imageView4&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;16dp&quot;<br>        android:layout_marginLeft=&quot;16dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/ic_circle_shape&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/linearLayout4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:layout_width=&quot;4dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/view5&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:layout_width=&quot;4dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/imageView4&quot; /&gt;<br><br>    &lt;de.hdodenhof.circleimageview.CircleImageView<br>        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>        android:id=&quot;@+id/dealProductImage&quot;<br>        android:layout_width=&quot;150dp&quot;<br>        android:layout_height=&quot;150dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;32dp&quot;<br>        android:layout_marginRight=&quot;32dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/bb&quot;<br>        app:civ_border_color=&quot;#cccccc&quot;<br>        app:civ_border_width=&quot;4dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:id=&quot;@+id/view5&quot;<br>        android:layout_width=&quot;0dp&quot;<br>        android:layout_height=&quot;4dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/textView32&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;16sp&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/productPrice&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;20sp&quot;<br>        android:textStyle=&quot;bold&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/textView32&quot; /&gt;<br><br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><h4>item_card_end.xml</h4><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;270dp&quot;&gt;<br><br>    &lt;LinearLayout<br>        android:id=&quot;@+id/linearLayout4&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;24dp&quot;<br>        android:layout_marginLeft=&quot;24dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot;&gt;<br><br>        &lt;TextView<br>            android:id=&quot;@+id/monthPurchased&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:text=&quot;AUG&quot;<br>            android:textColor=&quot;#757575&quot; /&gt;<br><br>        &lt;TextView<br>            android:id=&quot;@+id/yearPurchased&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:layout_marginTop=&quot;4dp&quot;<br>            android:text=&quot;2018&quot;<br>            android:textColor=&quot;#444444&quot; /&gt;<br>    &lt;/LinearLayout&gt;<br><br>    &lt;ImageView<br>        android:id=&quot;@+id/imageView4&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;16dp&quot;<br>        android:layout_marginLeft=&quot;16dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/ic_circle_shape&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/linearLayout4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:layout_width=&quot;4dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/view5&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;de.hdodenhof.circleimageview.CircleImageView xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>        android:id=&quot;@+id/dealProductImage&quot;<br>        android:layout_width=&quot;150dp&quot;<br>        android:layout_height=&quot;150dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;32dp&quot;<br>        android:layout_marginRight=&quot;32dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:src=&quot;@drawable/iphone&quot;<br>        app:civ_border_color=&quot;#cccccc&quot;<br>        app:civ_border_width=&quot;4dp&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;View<br>        android:id=&quot;@+id/view5&quot;<br>        android:layout_width=&quot;0dp&quot;<br>        android:layout_height=&quot;4dp&quot;<br>        android:background=&quot;#cccccc&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/imageView4&quot;<br>        app:layout_constraintTop_toTopOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/textView32&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;16sp&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/dealProductImage&quot; /&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/productPrice&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginLeft=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginRight=&quot;8dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:text=&quot;&quot;<br>        android:textColor=&quot;@color/colorPrimary&quot;<br>        android:textSize=&quot;20sp&quot;<br>        android:textStyle=&quot;bold&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;@+id/dealProductImage&quot;<br>        app:layout_constraintStart_toEndOf=&quot;@+id/view5&quot;<br>        app:layout_constraintTop_toBottomOf=&quot;@+id/textView32&quot; /&gt;<br><br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><h4>TimeLineModel.java</h4><pre>public class TimeLineModel {<br>    public int getType() {<br>        return type;<br>    }<br><br>    public void setType(int type) {<br>        this.type = type;<br>    }<br><br>    public int getImageFileName() {<br>        return imageFileName;<br>    }<br><br>    public void setImageFileName(int imageFileName) {<br>        this.imageFileName = imageFileName;<br>    }<br><br>    public String getProductName() {<br>        return productName;<br>    }<br><br>    public void setProductName(String productName) {<br>        this.productName = productName;<br>    }<br><br>    public String getProductPrice() {<br>        return productPrice;<br>    }<br><br>    public void setProductPrice(String productPrice) {<br>        this.productPrice = productPrice;<br>    }<br><br>    public String getMonth() {<br>        return month;<br>    }<br><br>    public void setMonth(String month) {<br>        this.month = month;<br>    }<br><br>    public String getYear() {<br>        return year;<br>    }<br><br>    public void setYear(String year) {<br>        this.year = year;<br>    }<br><br>    public int type;<br><br>    public TimeLineModel(int type, int imageFileName, String productName, String productPrice, String month, String year) {<br>        this.type = type;<br>        this.imageFileName = imageFileName;<br>        this.productName = productName;<br>        this.productPrice = productPrice;<br>        this.month = month;<br>        this.year = year;<br>    }<br><br>    public int imageFileName;<br>    public String productName;<br>    public String productPrice;<br>    public String month;<br>    public String year;<br>}</pre><h4>TimeLineActivity.java</h4><pre>public class TimeLineActivity extends AppCompatActivity {<br><br>    RecyclerView rv;<br>    TimeLineAdapter timeLineAdapter;<br>    ArrayList&lt;TimeLineModel&gt; rvList = new ArrayList&lt;&gt;();<br>    @Override<br>    protected void onCreate(Bundle savedInstanceState) {<br>        super.onCreate(savedInstanceState);<br>        setContentView(R.layout.<em>activity_time_line</em>);<br>        initLayout();<br>        initData();<br>    }<br><br>    private void initData() {<br>        TimeLineModel timeLineDummmy1 = new TimeLineModel(1,R.drawable.<em>bb</em>,&quot;BlackBerry&quot;, &quot;Rs 25000.00&quot;,&quot;JAN&quot;,&quot;2018&quot;);<br>        rvList.add(timeLineDummmy1);<br>        TimeLineModel timeLineDummmy2 = new TimeLineModel(2,R.drawable.<em>samsung</em>,&quot;Samsung&quot;, &quot;Rs 65000.00&quot;,&quot;OCt&quot;,&quot;2017&quot;);<br>        rvList.add(timeLineDummmy2);<br>        TimeLineModel timeLineDummmy3 = new TimeLineModel(2,R.drawable.<em>oneplus6</em>,&quot;One Plus&quot;, &quot;Rs 45000.00&quot;,&quot;AUG&quot;,&quot;2018&quot;);<br>        rvList.add(timeLineDummmy3);<br>        TimeLineModel timeLineDummmy4 = new TimeLineModel(2,R.drawable.<em>iphone</em>,&quot;Iphone&quot;, &quot;Rs 88500.00&quot;,&quot;NOV&quot;,&quot;2016&quot;);<br>        rvList.add(timeLineDummmy4);<br>        TimeLineModel timeLineDummmy5 = new TimeLineModel(2,R.drawable.<em>samsung</em>,&quot;Samsung&quot;, &quot;Rs 65000.00&quot;,&quot;MAR&quot;,&quot;2015&quot;);<br>        rvList.add(timeLineDummmy5);<br>        TimeLineModel timeLineDummmy6 = new TimeLineModel(2,R.drawable.<em>oneplus6</em>,&quot;One Plus&quot;, &quot;Rs 45000.00&quot;,&quot;FEB&quot;,&quot;2018&quot;);<br>        rvList.add(timeLineDummmy6);<br>        TimeLineModel timeLineDummmy7 = new TimeLineModel(3,R.drawable.<em>iphone</em>,&quot;Iphone&quot;, &quot;Rs 88500.00&quot;,&quot;MAY&quot;,&quot;2006&quot;);<br>        rvList.add(timeLineDummmy7);<br>        timeLineAdapter.notifyDataSetChanged();<br>    }<br><br>    private void initLayout() {<br>        rv = findViewById(R.id.<em>rv</em>);<br>        LinearLayoutManager mLayoutManager = new LinearLayoutManager(this);<br>        rv.setLayoutManager(mLayoutManager);<br>        timeLineAdapter = new TimeLineAdapter(this,rvList);<br>        rv.setAdapter(timeLineAdapter);<br>    }<br><br>    public class TimeLineAdapter extends RecyclerView.Adapter {<br>        private static final int <em>VIEW_TYPE_DEAL_FIRST_ITEM </em>= 1;<br>        private static final int <em>VIEW_TYPE_DEAL_MIDDLE_ITEM </em>= 2;<br>        private static final int <em>VIEW_TYPE_DEAL_LAST_ITEM </em>= 3;<br><br>        private Context mContext;<br>        private ArrayList&lt;TimeLineModel&gt; mDealsList;<br>        public TimeLineAdapter(Context context, ArrayList&lt;TimeLineModel&gt; mDealsListData) {<br>            mContext = context;<br>            mDealsList = mDealsListData;<br>        }<br>        @Override<br>        public int getItemCount() {<br>            return mDealsList.size();<br>        }<br>        @Override<br>        public int getItemViewType(int position) {<br>            TimeLineModel deal = mDealsList.get(position);<br>            if (deal.getType() == 1) {<br>                return <em>VIEW_TYPE_DEAL_FIRST_ITEM</em>;<br>            } else if(deal.getType() == 2) {<br>                return <em>VIEW_TYPE_DEAL_MIDDLE_ITEM</em>;<br>            } else {<br>                return <em>VIEW_TYPE_DEAL_LAST_ITEM</em>;<br>            }<br>        }<br>        @Override<br>        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {<br>            View view;<br>            if (viewType == <em>VIEW_TYPE_DEAL_FIRST_ITEM</em>) {<br>                view = LayoutInflater.<em>from</em>(parent.getContext())<br>                        .inflate(R.layout.<em>item_card_type_start</em>, parent, false);<br>                return new FirstDealHolder(view);<br>            } else if (viewType == <em>VIEW_TYPE_DEAL_MIDDLE_ITEM</em>) {<br>                view = LayoutInflater.<em>from</em>(parent.getContext())<br>                        .inflate(R.layout.<em>item__card_type_middle</em>, parent, false);<br>                return new MiddleDealHolder(view);<br>            } else if(viewType == <em>VIEW_TYPE_DEAL_LAST_ITEM</em>) {<br>                view = LayoutInflater.<em>from</em>(parent.getContext())<br>                        .inflate(R.layout.<em>item_card_end</em>, parent, false);<br>                return new LastDealHolder(view);<br>            }<br>            return null;<br>        }<br>        @Override<br>        public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {<br>            TimeLineModel dealsModel = mDealsList.get(position);<br>            switch (holder.getItemViewType()) {<br>                case <em>VIEW_TYPE_DEAL_FIRST_ITEM</em>:<br>                    ((FirstDealHolder) holder).bind(dealsModel);<br>                    break;<br>                case <em>VIEW_TYPE_DEAL_MIDDLE_ITEM</em>:<br>                    ((MiddleDealHolder) holder).bind(dealsModel);<br>                    break;<br>                case <em>VIEW_TYPE_DEAL_LAST_ITEM</em>:<br>                    ((LastDealHolder) holder).bind(dealsModel);<br>                    break;<br>            }<br>        }<br>        private class FirstDealHolder extends RecyclerView.ViewHolder {<br>            TextView monthPurchased, yearPurchased,productName,productPrice;<br>            CircleImageView dealProductImage;<br>            FirstDealHolder(View itemView) {<br>                super(itemView);<br>                monthPurchased =  itemView.findViewById(R.id.<em>monthPurchased</em>);<br>                yearPurchased =  itemView.findViewById(R.id.<em>yearPurchased</em>);<br>                dealProductImage = itemView.findViewById(R.id.<em>dealProductImage</em>);<br>                productName = itemView.findViewById(R.id.<em>textView32</em>);<br>                productPrice = itemView.findViewById(R.id.<em>productPrice</em>);<br>            }<br>            void bind(TimeLineModel dealsModel) {<br>                monthPurchased.setText(dealsModel.month);<br>                yearPurchased.setText(dealsModel.year);<br>                productName.setText(dealsModel.productName);<br>                productPrice.setText(dealsModel.productPrice);<br>            }<br>        }<br>        private class MiddleDealHolder extends RecyclerView.ViewHolder {<br>            TextView monthPurchased, yearPurchased,productName,productPrice;<br>            CircleImageView dealProductImage;<br>            MiddleDealHolder(View itemView) {<br>                super(itemView);<br>                monthPurchased =  itemView.findViewById(R.id.<em>monthPurchased</em>);<br>                yearPurchased =  itemView.findViewById(R.id.<em>yearPurchased</em>);<br>                dealProductImage = itemView.findViewById(R.id.<em>dealProductImage</em>);<br>                productName = itemView.findViewById(R.id.<em>textView32</em>);<br>                productPrice = itemView.findViewById(R.id.<em>productPrice</em>);<br>            }<br>            void bind(TimeLineModel dealsModel) {<br>                monthPurchased.setText(dealsModel.month);<br>                yearPurchased.setText(dealsModel.year);<br>                productName.setText(dealsModel.productName);<br>                productPrice.setText(dealsModel.productPrice);<br>            }<br>        }<br><br>        private class LastDealHolder extends RecyclerView.ViewHolder {<br>            TextView monthPurchased, yearPurchased,productName,productPrice;<br>            CircleImageView dealProductImage;<br>            LastDealHolder(View itemView) {<br>                super(itemView);<br>                monthPurchased =  itemView.findViewById(R.id.<em>monthPurchased</em>);<br>                yearPurchased =  itemView.findViewById(R.id.<em>yearPurchased</em>);<br>                dealProductImage = itemView.findViewById(R.id.<em>dealProductImage</em>);<br>                productName = itemView.findViewById(R.id.<em>textView32</em>);<br>                productPrice = itemView.findViewById(R.id.<em>productPrice</em>);<br>            }<br>            void bind(TimeLineModel dealsModel) {<br>                monthPurchased.setText(dealsModel.month);<br>                yearPurchased.setText(dealsModel.year);<br>                productName.setText(dealsModel.productName);<br>                productPrice.setText(dealsModel.productPrice);<br>            }<br>        }<br>    }<br>}</pre><p><a href="https://github.com/bineeshbabu/multiviewrecyclerview">bineeshbabu/multiviewrecyclerview</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df7eeeea9031" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>