dinocore1/DevsmartLib-Android — Issue #12: Issue on RemoteImageView(https://github.com/kaeppler/ignition/blob/master/ignition-core/ignition-core-lib/src/com/github/ignition/core/widgets/RemoteImageView.java) used together with HorizontalListView
Author: tfleo
Created: 2012-02-14 05:56:37+00:00
State: open

RemoteImageView is custom widget to handle webimage and do lazy loading and caching routine. It will show progress spinner during image loading and once finished, the actual image will be showed up. however I can't get any web image to load when i put the view within the list, not even progress spinner showed up (i only see the spinner for brief moment when doing quick scroll). I think there is internal issues here. Can you enlighten me on how to fix this?

gallery_layout:

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ignition="http://github.com/ignition/schema"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="2dp">

gallery_listentry:

xmlns:ignition="http://github.com/ignition/schema"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="4dp"
android:background="#fff" >

package com.test;

import android.app.Activity;

import android.os.Bundle;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

import android.widget.BaseAdapter;

import android.widget.TextView;

import com.devsmart.android.ui.HorizontialListView;

import com.github.ignition.core;

public class HorizontalListViewDemo extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.gallery_layout);

HorizontialListView listview = (HorizontialListView) findViewById(R.id.gallery_list);
listview.setAdapter(mAdapter);

}

private static String[] url = new String[]{ "http://www.google.com.sg/logos/2012/vday12-res.png",
"http://www.google.com.sg/logos/2012/vday12-res.png",
"http://www.google.com.sg/logos/2012/vday12-res.png" };

private BaseAdapter mAdapter = new BaseAdapter() {

@Override
public int getCount() {
return url.length;
}

@Override
public Object getItem(int position) {
return null;
}

@Override
public long getItemId(int position) {
return 0;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View retval = LayoutInflater.from(parent.getContext()).inflate(R.layout.gallery_listentry, null);
RemoteImageView img = (RemoteImageView) retval.findViewById(R.id.img);
img.setImageUrl(url[position]);
img.loadImage();

return retval;
}

};
}