开发者

Droidfu WebImageView and GridView

Can someone please tell me why this GridView does not scroll smoothly even when the images are grabbed from the Droidfu cache?

I've tried WebImageView, my own defaulthandler with ImageLoader, removed the sqlLite calls and just used static URLs, tried hiding and fading in the image after it is loaded, etc. Can't seem to get smooth scrolling (getting jerkiness). Is it DroidFu that is causing this? I would hate to dump Droidfu since I already invested in it. Obviously local image resources inserted into the GridView scroll fine. I've spent way too long on this problem.

    public View getView(int position, View convertView, ViewGroup parent) {

        mCursor.moveToPosition(position);

        String thumbUrl=imagePath+mCursor.getString(mCursor.getColumnIndex("imagename"));
        if (convertView == null) {
            convertView=(View)mInflater.inflate(R.layout.grid_thumb_layout, null);
        }
        WebImageView thumb=(WebImageView)convertView.findViewById(R.id.thumb);
        thumb.reset();
        thumb.setImageUrl(thumbUrl);
        thumb.loadImage();
        return convertView;

    }

xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<GridView android:id="@+id/gridview" android:layout_width="fill_parent"
    android:layout_height="fill_parent"  android:numColumns="auto_fit"
    android:verticalSpacing="2dp" android:horizontalSpacing="2dp"
    android:columnWidth="150dp" 
    android:rowHeight="150dp" 
    android:fadingEdge="vertical"
    android:paddingLeft="2dp" android:paddingRight="2dp"
    android:gravity="center" />
</RelativeLayout>


<?xml versio开发者_运维百科n="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="150dp"
android:layout_height="150dp">
<com.github.droidfu.widgets.WebImageView android:id="@+id/thumb"
    android:scaleType="fitCenter" android:layout_weight="1"
    android:layout_width="150dp"
    android:layout_height="150dp" xmlns:android="http://schemas.android.com/apk/res/android" >
</com.github.droidfu.widgets.WebImageView>
</RelativeLayout>


Try replacing WebImageView with RemoteImageView which is a similar class in the Ignition project by the same author.

According to this, development on Droid-Fu is going to stop and it will be 'rebranded' as Ignition.

Ignition has a similar class called RemoteImageView. Usage is basically the same but it appears they've reworked the back end a bit so it's cache response is better. I tried it with a ListView that was giving the loading forever problem. Worked for me (although it introduced some other problems but they appear to be minor).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜