Android Open Source - android-listview-custom-view Item Adapter






From Project

Back to project page android-listview-custom-view.

License

The source code is released under:

MIT License

If you think the Android project android-listview-custom-view listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bignerdranch.android.listitemviewdemo;
//from  w  w  w .  j ava 2  s  . c  o m
import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class ItemAdapter extends ArrayAdapter<Item> {
    
    public ItemAdapter(Context c, List<Item> items) {
        super(c, 0, items);
    }
    
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ItemView itemView = (ItemView)convertView;
        if (null == itemView)
            itemView = ItemView.inflate(parent);
        itemView.setItem(getItem(position));
        return itemView;
    }

}




Java Source Code List

com.android.debug.hv.ViewServer.java
com.bignerdranch.android.listitemviewdemo.ItemAdapter.java
com.bignerdranch.android.listitemviewdemo.ItemListFragment.java
com.bignerdranch.android.listitemviewdemo.ItemView.java
com.bignerdranch.android.listitemviewdemo.Item.java
com.bignerdranch.android.listitemviewdemo.ListActivity.java