// Path: repay/src/main/java/com/repay/android/Application.java
// public class Application extends android.app.Application {
// 
//     private static final String TAG = Application.class.getSimpleName();
// 
// 	private static DisplayImageOptions mImageOptions;
// 	private ImageLoaderConfiguration mLoadConfig;
// 
// 	@Override
// 	public void onCreate()
// 	{
// 		super.onCreate();
// 		Log.d(TAG, "Image options now being set");
// 		mImageOptions = new DisplayImageOptions.Builder().resetViewBeforeLoading(true)
// 				.cacheInMemory(true).cacheOnDisk(true)
// 				.imageScaleType(ImageScaleType.NONE)
// 				.showImageOnLoading(R.drawable.friend_image_light)
// 				.showImageForEmptyUri(R.drawable.friend_image_light)
// 				.build();
// 		mLoadConfig = new ImageLoaderConfiguration.Builder(this).imageDownloader(new MyImageDownloader(this)).build();
// 		ImageLoader.getInstance().init(mLoadConfig);
// 	}
// 
// 	public static DisplayImageOptions getImageOptions()
// 	{
// 		return mImageOptions;
// 	}
// }
// 
// Path: repay/src/main/java/com/repay/android/model/Friend.java
// public class Friend implements Comparable<Friend>, Serializable {
// 	
// 	public static final String REPAYID = "repayID";
// 	public static final String LOOKUPURI = "lookupUri";
// 	public static final String NAME = "name";
// 	public static final String AMOUNT = "amount";
// 
// 	private String name, repayID;
// 	private BigDecimal debt;
// 	private String lookupURI;
// 	
// 	public Friend(String repayID, String lookupURI, String name, BigDecimal debt) {
// 		super();
// 		this.lookupURI = lookupURI;
// 		this.name = name;
// 		this.repayID = repayID;
// 		this.debt = debt;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getRepayID() {
// 		return repayID;
// 	}
// 
// 	public String getLookupURI() {
// 		return lookupURI;
// 	}
// 
// 	public BigDecimal getDebt() {
// 		return debt;
// 	}
// 
// 	public void setDebt(BigDecimal debt) {
// 		this.debt = debt;
// 	}
// 
// 	@Override
// 	public int compareTo(Friend another) {
// 		return another.getDebt().compareTo(debt);
// 	}
// 
// 	@Override
// 	public boolean equals(Object o) {
// 		return (o.getClass() == Friend.class && ((Friend) o).getRepayID().equals(repayID));
// 	}
// }


import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.repay.android.Application;
import com.repay.android.R;
import com.repay.android.model.Friend;
import java.util.ArrayList;
		notifyDataSetChanged();
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		View v = convertView;

		if (v == null)
		{
			LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(mLayoutID, null);
		}
		Friend friend = mFriends.get(position);
		TextView name = (TextView)v.findViewById(R.id.activity_friendchooser_name);
		final ImageView pic = (ImageView)v.findViewById(R.id.activity_friendchooser_pic);
		if (friend != null)
		{
			v.setTag(friend); // Stored as a tag to be retrieved later for OnItemClickListener

			// Colour the list item based on whether it is in the 'selected' list
			if (mSelectedFriends.contains(friend))
			{
				v.setBackgroundColor(SELECTED_COLOUR);
			}
			else
			{
				v.setBackgroundColor(DESELECTED_COLOUR);
			}
		}
// Path: repay/src/main/java/com/repay/android/Application.java
// public class Application extends android.app.Application {
// 
//     private static final String TAG = Application.class.getSimpleName();
// 
// 	private static DisplayImageOptions mImageOptions;
// 	private ImageLoaderConfiguration mLoadConfig;
// 
// 	@Override
// 	public void onCreate()
// 	{
// 		super.onCreate();
// 		Log.d(TAG, "Image options now being set");
// 		mImageOptions = new DisplayImageOptions.Builder().resetViewBeforeLoading(true)
// 				.cacheInMemory(true).cacheOnDisk(true)
// 				.imageScaleType(ImageScaleType.NONE)
// 				.showImageOnLoading(R.drawable.friend_image_light)
// 				.showImageForEmptyUri(R.drawable.friend_image_light)
// 				.build();
// 		mLoadConfig = new ImageLoaderConfiguration.Builder(this).imageDownloader(new MyImageDownloader(this)).build();
// 		ImageLoader.getInstance().init(mLoadConfig);
// 	}
// 
// 	public static DisplayImageOptions getImageOptions()
// 	{
// 		return mImageOptions;
// 	}
// }
// 
// Path: repay/src/main/java/com/repay/android/model/Friend.java
// public class Friend implements Comparable<Friend>, Serializable {
// 	
// 	public static final String REPAYID = "repayID";
// 	public static final String LOOKUPURI = "lookupUri";
// 	public static final String NAME = "name";
// 	public static final String AMOUNT = "amount";
// 
// 	private String name, repayID;
// 	private BigDecimal debt;
// 	private String lookupURI;
// 	
// 	public Friend(String repayID, String lookupURI, String name, BigDecimal debt) {
// 		super();
// 		this.lookupURI = lookupURI;
// 		this.name = name;
// 		this.repayID = repayID;
// 		this.debt = debt;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getRepayID() {
// 		return repayID;
// 	}
// 
// 	public String getLookupURI() {
// 		return lookupURI;
// 	}
// 
// 	public BigDecimal getDebt() {
// 		return debt;
// 	}
// 
// 	public void setDebt(BigDecimal debt) {
// 		this.debt = debt;
// 	}
// 
// 	@Override
// 	public int compareTo(Friend another) {
// 		return another.getDebt().compareTo(debt);
// 	}
// 
// 	@Override
// 	public boolean equals(Object o) {
// 		return (o.getClass() == Friend.class && ((Friend) o).getRepayID().equals(repayID));
// 	}
// }


// Path: repay/src/main/java/com/repay/android/adddebt/ChoosePersonAdapter.java
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.repay.android.Application;
import com.repay.android.R;
import com.repay.android.model.Friend;
import java.util.ArrayList;

		notifyDataSetChanged();
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		View v = convertView;

		if (v == null)
		{
			LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(mLayoutID, null);
		}
		Friend friend = mFriends.get(position);
		TextView name = (TextView)v.findViewById(R.id.activity_friendchooser_name);
		final ImageView pic = (ImageView)v.findViewById(R.id.activity_friendchooser_pic);
		if (friend != null)
		{
			v.setTag(friend); // Stored as a tag to be retrieved later for OnItemClickListener

			// Colour the list item based on whether it is in the 'selected' list
			if (mSelectedFriends.contains(friend))
			{
				v.setBackgroundColor(SELECTED_COLOUR);
			}
			else
			{
				v.setBackgroundColor(DESELECTED_COLOUR);
			}
		}
		ImageLoader.getInstance().displayImage(friend.getLookupURI(), pic, Application.getImageOptions());