dinocore1 / DevsmartLib-Android

A Horizontal ListView for Android

Home Page:http://www.dev-smart.com/archives/34

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

opened this issue · comments

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">

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="5dp"
    android:paddingLeft="8dp"
    android:paddingTop="5dp"
    android:text="Foods around here:"
    android:textSize="16dp" />

<com.devsmart.android.ui.HorizontalListView 
    android:id="@+id/gallery_list"
    android:layout_width="fill_parent"
    android:layout_height="400dp" />
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" >

<com.github.ignition.core.widgets.RemoteImageView
    android:id="@+id/img"
    android:layout_width="400dp"
    android:layout_height="280dp"
    android:background="@color/dark_brown"
    android:padding="2dp"
    ignition:progressDrawable="@drawable/ic_launcher"
    ignition:autoLoad="false"
    ignition:errorDrawable="@drawable/icon"
    ignition:defaultDrawable="@drawable/place_snacks"
    android:scaleType="fitXY"/>

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;  
}  

};
}