// Path: src/com/dotcool/reader/model/DownloadModel.java
// public class DownloadModel {
// 	private String downloadName;
//     private Integer downloadProgress;
//     private String downloadId;
//     private String downloadMessage;
// 
//     public DownloadModel (String id, String name, Integer progress) {
//     	downloadName = name;
//     	downloadProgress = progress;
//     	downloadId = id;
//     	downloadMessage = "N/A";
//     }
// 
//     public String getDownloadName() {
//         return downloadName;
//     }
//     public void setDownloadName(String downloadName) {
//         this.downloadName = downloadName;
//     }
// 
//     public String getDownloadId() {
//         return this.downloadId;
//     }
//     public void setDownloadId(String downloadId) {
//         this.downloadId = downloadId;
//     }
// 
//     public Integer getDownloadProgress() {
//         return downloadProgress;
//     }
//     public void setDownloadProgress(Integer	progress) {
//         this.downloadProgress = progress;
//     }
// 
// 	public String getDownloadMessage() {
// 		return downloadMessage;
// 	}
// 
// 	public void setDownloadMessage(String downloadMessage) {
// 		this.downloadMessage = downloadMessage;
// 	}
// }


import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.dotcool.R;
import com.dotcool.reader.model.DownloadModel;
                this.downloads = items;
        }

        @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(R.layout.download_list_item, null);
                }
                DownloadModel d = downloads.get(position);
                if (d != null) {
                        TextView name = (TextView) v.findViewById(R.id.download_name);
                        TextView message = (TextView) v.findViewById(R.id.download_Message);
                        ProgressBar progress = (ProgressBar) v.findViewById(R.id.download_progress_bar);
                        if (name != null) {
                        	name.setText(d.getDownloadName());                            }
                        if(progress != null){
                        	progress.setProgress(d.getDownloadProgress());
                        }
                        if(message != null ) {
                        	if(d.getDownloadMessage() != null) {
                        		message.setText(d.getDownloadMessage());
                        		message.setVisibility(View.VISIBLE);
                        	}
                        	else {
                        		message.setVisibility(View.GONE);
                        	}
                        }
                }
// Path: src/com/dotcool/reader/model/DownloadModel.java
// public class DownloadModel {
// 	private String downloadName;
//     private Integer downloadProgress;
//     private String downloadId;
//     private String downloadMessage;
// 
//     public DownloadModel (String id, String name, Integer progress) {
//     	downloadName = name;
//     	downloadProgress = progress;
//     	downloadId = id;
//     	downloadMessage = "N/A";
//     }
// 
//     public String getDownloadName() {
//         return downloadName;
//     }
//     public void setDownloadName(String downloadName) {
//         this.downloadName = downloadName;
//     }
// 
//     public String getDownloadId() {
//         return this.downloadId;
//     }
//     public void setDownloadId(String downloadId) {
//         this.downloadId = downloadId;
//     }
// 
//     public Integer getDownloadProgress() {
//         return downloadProgress;
//     }
//     public void setDownloadProgress(Integer	progress) {
//         this.downloadProgress = progress;
//     }
// 
// 	public String getDownloadMessage() {
// 		return downloadMessage;
// 	}
// 
// 	public void setDownloadMessage(String downloadMessage) {
// 		this.downloadMessage = downloadMessage;
// 	}
// }


// Path: src/com/dotcool/reader/adapter/DownloadListAdapter.java
import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.dotcool.R;
import com.dotcool.reader.model.DownloadModel;

                this.downloads = items;
        }

        @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(R.layout.download_list_item, null);
                }
                DownloadModel d = downloads.get(position);
                if (d != null) {
                        TextView name = (TextView) v.findViewById(R.id.download_name);
                        TextView message = (TextView) v.findViewById(R.id.download_Message);
                        ProgressBar progress = (ProgressBar) v.findViewById(R.id.download_progress_bar);
                        if (name != null) {
                        	name.setText(d.getDownloadName());                            }
                        if(progress != null){
                        	progress.setProgress(d.getDownloadProgress());
                        }
                        if(message != null ) {
                        	if(d.getDownloadMessage() != null) {
                        		message.setText(d.getDownloadMessage());
                        		message.setVisibility(View.VISIBLE);
                        	}
                        	else {
                        		message.setVisibility(View.GONE);
                        	}
                        }
                }
                return v;