DroidFu - Scale/Stretch a WebImageView

267 Views Asked by At

I have collection of 65x65 pixel source image I'm retrieving via DroidFu. I want to present them at 80x80dip to better fit my listView row contents.

Given that I do not want to resize at the source (server) what would be a good approach to scale a droidfu WebImageView?

@Override
public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            v = mInflater.inflate(R.layout.my_feed_item_row, null);
        }
        MyFeedItem o = items.get(position);
        if (o != null) {
                TextView line1 = (TextView) v.findViewById(R.id.line1);
                TextView line2 = (TextView) v.findViewById(R.id.line2);
                TextView line3 = (TextView) v.findViewById(R.id.line3);
                TextView line4 = (TextView) v.findViewById(R.id.line4);
                if (line1 != null) {
                      line1.setText(o.getLine1());                            }
                if(line2 != null){
                      line2.setText(o.getLine2());
                }
                if(line3 != null){
                    line3.setText(o.getLine3());
                }
                if(line4 != null){
                    line4.setText(o.getLine4());
                }

                WebImageView rowThumbnail = (WebImageView);
                v.findViewById(R.id.feed_row_thumbnail);
                rowThumbnail.setImageUrl(o.getIconURLString());
                rowThumbnail.loadImage();
        }
        return v;
    }

}
1

There are 1 best solutions below

0
On

check inside the code for webimageview , the layout params have been set to wrap content .Change it to fill parent

and also change Scaletype to fit xy