// Path: iview-api/src/main/java/com/github/aview/api/Episode.java
// public interface Episode extends Serializable {
// 
//     // public Integer getId(); // a, id,
// 
// 	public String getSeriesTitle();
// 
//     public String getTitle(); // b, title, title + subTitle
// 
//     public String getEpisodeTitle(); // , basicTitle, subTitle
// 
//     public String getDescription(); // d, description, description
// 
//     // public String getCategory(); e, , category
// 
//     public Date getAired(); // h, transmitDate, transmitDate
// 
//     public Date getExpires(); // g, expireDate, expireDate
// 
//     public Date getPublished(); // f, pubDate, pubDate
// 
//     // public Integer getSize(); i, ,
// 
//     public Integer getDuration(); // j, duration, media:content/@duration (seconds)
// 
//     // public String getEpisodeUrlText(); // k, ,
// 
//     public String getEpisodeUrl(); // l, shareUrl, guid/link/media:player
// 
//     public String getRating(); // m , rating, rating
// 
//     // public String getFilename(); // n,
// 
//     public String getWarning(); // o, warning, warning
// 
//     public String getVideoUrl(); // r, videoAsset, videoAsset
// 
//     public String getThumbnailUrl(); // s, thumbnail, media:thumbnail
// 
//     // public Integer isNews24(); t, ,
// 
//     // public String getSeriesNumber(); // u, , series
// 
//     // public String getEpisodeNumber(); // v, , episode
// }
// 
// Path: aview/src/main/java/com/github/aview/util/FormatUtil.java
// public class FormatUtil {
// 
// 	public static String formatDuration(int seconds) {
// 		return formatDuration(seconds, 4);
// 	}
// 
// 	public static String formatDuration(int seconds, int sigFigs) {
// 		int days = seconds / 86400;
// 		int hours = (seconds % 86400) / 3600;
// 		int minutes = (seconds % 3600) / 60;
// 		int secondRemainder = seconds % 60;
// 		StringBuilder sb = new StringBuilder();
// 		if (days > 0 && sigFigs > 0) {
// 			sb.append(days);
// 			sb.append(days == 1 ? "day " : " days ");
// 			sigFigs--;
// 		}
// 		if (hours > 0 && sigFigs > 0) {
// 			sb.append(hours);
// 			sb.append(hours == 1 ? " hour " : " hours ");
// 			sigFigs--;
// 		}
// 		if (minutes > 0 && sigFigs > 0) {
// 			sb.append(minutes);
// 			sb.append(minutes == 1 ? " minute " : " minutes ");
// 			sigFigs--;
// 		}
// 		if (secondRemainder > 0 && sigFigs > 0) {
// 			sb.append(secondRemainder);
// 			sb.append(secondRemainder == 1 ? " second" : " seconds");
// 			sigFigs--;
// 		}
// 
// 		return sb.toString();
// 	}
// 
// 	public static String formatShortDuration(int seconds) {
// 		int hours = seconds / 3600;
// 		int minutes = (seconds % 3600) / 60;
// 		int secondRemainder = seconds % 60;
// 		StringBuilder sb = new StringBuilder();
// 		if (hours > 0) {
// 			sb.append(hours);
// 			sb.append(":");
// 		}
// 		if (minutes < 10)
// 			sb.append('0');
// 		sb.append(minutes);
// 		sb.append(":");
// 		if (secondRemainder < 10)
// 			sb.append('0');
// 		sb.append(secondRemainder);
// 
// 		return sb.toString();
// 	}
// 
// }


import com.google.common.base.Strings;
import com.squareup.picasso.Picasso;
import java.util.List;
import android.content.Context;
import android.util.Log;
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.github.aview.api.Episode;
import com.github.aview.util.FormatUtil;
package com.github.aview.app;

/*
 * #%L
 * aview
 * %%
 * Copyright (C) 2013 The aview authors
 * %%
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * #L%
 */





/**
 * @author aview
 * 
 */
public class EpisodeListAdapter extends ArrayAdapter<Episode> {

	private static final String TAG = "EpisodeAdapter";

	private final int itemViewResourceId;

	private final LayoutInflater mInflater;

	/**
	 * @param context
	 * @param itemViewResourceId
	 * @param imageFetcher
	 */
// Path: iview-api/src/main/java/com/github/aview/api/Episode.java
// public interface Episode extends Serializable {
// 
//     // public Integer getId(); // a, id,
// 
// 	public String getSeriesTitle();
// 
//     public String getTitle(); // b, title, title + subTitle
// 
//     public String getEpisodeTitle(); // , basicTitle, subTitle
// 
//     public String getDescription(); // d, description, description
// 
//     // public String getCategory(); e, , category
// 
//     public Date getAired(); // h, transmitDate, transmitDate
// 
//     public Date getExpires(); // g, expireDate, expireDate
// 
//     public Date getPublished(); // f, pubDate, pubDate
// 
//     // public Integer getSize(); i, ,
// 
//     public Integer getDuration(); // j, duration, media:content/@duration (seconds)
// 
//     // public String getEpisodeUrlText(); // k, ,
// 
//     public String getEpisodeUrl(); // l, shareUrl, guid/link/media:player
// 
//     public String getRating(); // m , rating, rating
// 
//     // public String getFilename(); // n,
// 
//     public String getWarning(); // o, warning, warning
// 
//     public String getVideoUrl(); // r, videoAsset, videoAsset
// 
//     public String getThumbnailUrl(); // s, thumbnail, media:thumbnail
// 
//     // public Integer isNews24(); t, ,
// 
//     // public String getSeriesNumber(); // u, , series
// 
//     // public String getEpisodeNumber(); // v, , episode
// }
// 
// Path: aview/src/main/java/com/github/aview/util/FormatUtil.java
// public class FormatUtil {
// 
// 	public static String formatDuration(int seconds) {
// 		return formatDuration(seconds, 4);
// 	}
// 
// 	public static String formatDuration(int seconds, int sigFigs) {
// 		int days = seconds / 86400;
// 		int hours = (seconds % 86400) / 3600;
// 		int minutes = (seconds % 3600) / 60;
// 		int secondRemainder = seconds % 60;
// 		StringBuilder sb = new StringBuilder();
// 		if (days > 0 && sigFigs > 0) {
// 			sb.append(days);
// 			sb.append(days == 1 ? "day " : " days ");
// 			sigFigs--;
// 		}
// 		if (hours > 0 && sigFigs > 0) {
// 			sb.append(hours);
// 			sb.append(hours == 1 ? " hour " : " hours ");
// 			sigFigs--;
// 		}
// 		if (minutes > 0 && sigFigs > 0) {
// 			sb.append(minutes);
// 			sb.append(minutes == 1 ? " minute " : " minutes ");
// 			sigFigs--;
// 		}
// 		if (secondRemainder > 0 && sigFigs > 0) {
// 			sb.append(secondRemainder);
// 			sb.append(secondRemainder == 1 ? " second" : " seconds");
// 			sigFigs--;
// 		}
// 
// 		return sb.toString();
// 	}
// 
// 	public static String formatShortDuration(int seconds) {
// 		int hours = seconds / 3600;
// 		int minutes = (seconds % 3600) / 60;
// 		int secondRemainder = seconds % 60;
// 		StringBuilder sb = new StringBuilder();
// 		if (hours > 0) {
// 			sb.append(hours);
// 			sb.append(":");
// 		}
// 		if (minutes < 10)
// 			sb.append('0');
// 		sb.append(minutes);
// 		sb.append(":");
// 		if (secondRemainder < 10)
// 			sb.append('0');
// 		sb.append(secondRemainder);
// 
// 		return sb.toString();
// 	}
// 
// }


// Path: aview/src/main/java/com/github/aview/app/EpisodeListAdapter.java
import com.google.common.base.Strings;
import com.squareup.picasso.Picasso;
import java.util.List;
import android.content.Context;
import android.util.Log;
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.github.aview.api.Episode;
import com.github.aview.util.FormatUtil;

package com.github.aview.app;

/*
 * #%L
 * aview
 * %%
 * Copyright (C) 2013 The aview authors
 * %%
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * #L%
 */





/**
 * @author aview
 * 
 */
public class EpisodeListAdapter extends ArrayAdapter<Episode> {

	private static final String TAG = "EpisodeAdapter";

	private final int itemViewResourceId;

	private final LayoutInflater mInflater;

	/**
	 * @param context
	 * @param itemViewResourceId
	 * @param imageFetcher
	 */
	public EpisodeListAdapter(Context context, int itemViewResourceId, List<Episode> episodes) {