Custom Listview inside scrollview with horizontal gridview
<p>I have integrated listview inside a scrollview in android. Also the listview is customised. Each listview item is a horizontal gridview. My whole screen consists of image at the top , below that a listview and each listitem is a horizontal gridview. When I am scrolling my screen vertically then it works perfectly fine. But <strong>once I scroll any item of lisview horizontally, my app starts lagging and then no scroll works properly</strong>. </p>

<p>I want to develop the UI same as of wynk music app home screen (Dynamic listview with each listview item as horizontal gridview).</p>

<p>Find my code below :
Main activity layout:
    
    </p>

<pre><code>    &lt;LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:weightSum="3"
        android:background="@color/white"
        android:gravity="center_vertical"
        style="@style/Base.Widget.AppCompat.Light.ActionBar.TabText"
        &gt;

        &lt;ImageView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:id="@+id/imageView4"
            android:gravity="center"
            android:src="@drawable/location"
            android:layout_weight="0.5" /&gt;

        &lt;TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="temp location"
            android:gravity="center"
            android:id="@+id/textView"
           android:layout_weight="2"
        /&gt;

        &lt;TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="Edit"
            android:textColor="@color/colorPrimary"
            android:gravity="center"
            android:id="@+id/textView1"
            /&gt;
        &lt;/LinearLayout&gt;

    &lt;LinearLayout android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:weightSum="9"
        android:layout_weight="9"
        android:background="@color/grey"
        xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;ImageView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:scaleType="fitXY"
        android:src="@drawable/offerbanner3"
        android:layout_weight="3" /&gt;

    &lt;com.designtest.NonScrollListView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="@color/white"
        android:dividerHeight="10.0sp"
        android:layout_weight="6"
        android:id="@+id/lvVendors" /&gt;
        &lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
&lt;/ScrollView&gt; 
</code></pre>

<p>Listview Item :</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="10dp"
    android:weightSum="10"
    android:orientation="vertical"&gt;

    &lt;TextView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:text="Vendor Name"
        android:paddingLeft="10dp"
        android:layout_weight="2"
        android:textColor="@color/colorPrimary"
        android:id="@+id/tvVendorNames"
        android:layout_marginBottom="5dp"
        android:textSize="15dp"/&gt;
    &lt;HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:scrollbars="none"
        android:layout_weight="8"
        android:id="@+id/title_horizontalScrollView"
        android:layout_margin="1dp"
        android:fillViewport="false"&gt;

        &lt;LinearLayout
            android:orientation="horizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            &gt;

            &lt;GridView
                android:layout_width="fill_parent"
                android:layout_height="match_parent"
                android:id="@+id/gvProductList"
                android:numColumns="2"
                android:horizontalSpacing="15dp"
                android:layout_gravity="center"
                /&gt;
        &lt;/LinearLayout&gt;
    &lt;/HorizontalScrollView&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>and finally item of horizontal gridview :</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp"
    android:weightSum="8.5"
    &gt;

        &lt;ImageView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="5"
            android:scaleType="fitXY"
            android:id="@+id/ivProduct" /&gt;

            &lt;TextView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:text="Product Name"
                android:textSize="12dp"
                android:layout_marginTop="3dp"
                android:id="@+id/tvProductNameList"
                android:textColor="@color/colorPrimary"
                android:gravity="center_vertical"
                android:layout_weight="1.5"/&gt;

            &lt;LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="2"
                android:weightSum="3"&gt;

                &lt;TextView
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:text="300"
                    android:drawableLeft="@drawable/rs"
                    android:textSize="12dp"
                    android:drawablePadding="4dp"
                    android:textColor="@color/colorPrimary"
                    android:gravity="center|left"
                    android:id="@+id/tvProductPriceList"
                    android:layout_weight="2"/&gt;


                &lt;ImageView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:src="@drawable/veg"
                    android:layout_weight="1"/&gt;
                &lt;/LinearLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>