ArathyAnand
ArathyAnand

Reputation: 71

Android list view scroll down lagging

I am using image lazy loader to display a list of custom items (where each row having image and text) However my list view lags on scroll down. How can i implement a list view with no scroll lag, just like the app listing list view in play store. Following is the list view xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/list_row_bg"
    android:orientation="horizontal" >

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="left" >

        <TextView
            android:id="@+id/txt_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="Title Post 1"
            android:textColor="@color/list_title"
            android:textSize="15dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/txt_posted_by"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/txt_title"
            android:text="Posted by Paul Curtin 4 days ago on sep05 2013" />

        <ImageView
            android:id="@+id/image_comments"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/txt_title"
            android:layout_margin="@dimen/list_comments_image_margin"
            android:layout_toLeftOf="@+id/textview_comments_count"
            android:layout_toRightOf="@+id/txt_posted_by"
            android:src="@drawable/icon_comments" />

        <TextView
            android:id="@+id/textview_comments_count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/txt_title"
            android:layout_toRightOf="@+id/txt_posted_by"
            android:padding="@dimen/list_category_padding"
            android:text="comments_count"
            android:textColor="@color/list_category"
            android:textSize="@dimen/list_comments_size" />

        <ImageView
            android:id="@+id/image_thumb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/txt_posted_by"
            android:layout_centerVertical="true"
            android:src="@drawable/no_image_small" />

        <TextView
            android:id="@+id/txt_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" 
            android:layout_toRightOf="@+id/image_thumb"
            android:layout_below="@+id/txt_posted_by"
            android:layout_alignParentRight="true"/>
    </RelativeLayout>

</LinearLayout>

Upvotes: 0

Views: 881

Answers (2)

AabidMulani
AabidMulani

Reputation: 2325

So the problem lies in the image loader: Try different image loaders

1] Universal Image Loader Here

2] Lazy List Loader Here

3] Volley Image Loader Here

Upvotes: 0

Biraj Zalavadia
Biraj Zalavadia

Reputation: 28484

Set this attribute of listview and try

android:scrollbars="none"


<ListView
        android:id="@+id/lstMyAlbum"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none" />

Upvotes: 2

Related Questions