// Path: android/src/main/java/com/xda/one/api/model/interfaces/Forum.java
// public interface Forum extends Parcelable {
// 
//     public String getTitle();
// 
//     public int getForumId();
// 
//     public int getParentId();
// 
//     public String getForumSlug();
// 
//     public boolean isSubscribed();
// 
//     public void setSubscribed(boolean subs);
// 
//     public String getImageUrl();
// 
//     public boolean hasChildren();
// 
//     public String getWebUri();
// 
//     public boolean canContainThreads();
// }
// 
// Path: android/src/main/java/com/xda/one/util/Utils.java
// public class Utils {
// 
//     public static String handleRetrofitErrorQuietly(final RetrofitError error) {
//         error.printStackTrace();
// 
//         InputStream inputStream = null;
//         try {
//             if (error.isNetworkError()) {
//                 Log.e("XDA-ONE", "Network error happened.");
//             } else {
//                 final TypedInput body = error.getResponse().getBody();
//                 if (body == null) {
//                     Log.e("XDA-ONE", "Unable to retrieve body");
//                     return null;
//                 }
//                 inputStream = body.in();
// 
//                 final String result = IOUtils.toString(inputStream);
//                 Log.e("XDA-ONE", result);
//                 return result;
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             IOUtils.closeQuietly(inputStream);
//         }
//         return null;
//     }
// 
//     public static <T> int getCollectionSize(final Collection<T> collection) {
//         return collection == null ? 0 : collection.size();
//     }
// 
//     public static boolean isCollectionEmpty(final Collection collection) {
//         return collection == null || collection.isEmpty();
//     }
// 
//     public static CharSequence getRelativeDate(final Context context, final long dateline) {
//         return DateUtils.getRelativeDateTimeString(context, dateline,
//                 DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS,
//                 DateUtils.FORMAT_NUMERIC_DATE);
//     }
// }


import com.xda.one.R;
import com.xda.one.api.model.interfaces.Forum;
import com.xda.one.ui.helper.ActionModeHelper;
import com.xda.one.util.Utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
package com.xda.one.ui;




public class ForumAdapter<T extends Forum>
        extends RecyclerView.Adapter<ForumAdapter.ForumViewHolder> {

    private final LayoutInflater mLayoutInflater;

    private final List<T> mForums;

    private final View.OnClickListener mListener;

    private final View.OnLongClickListener mLongClickListener;

    private final ActionModeHelper mModeHelper;

    private final ImageViewDeviceDelegate mImageViewDeviceDelegate;

    private final SubscribeButtonDelegate mSubscribeButtonDelegate;

    public ForumAdapter(final Context context, final View.OnClickListener listener,
            final View.OnLongClickListener longClickListener,
            final ActionModeHelper modeHelper,
            final ImageViewDeviceDelegate imageViewDeviceDelegate,
            final SubscribeButtonDelegate buttonDelegate) {
// Path: android/src/main/java/com/xda/one/api/model/interfaces/Forum.java
// public interface Forum extends Parcelable {
// 
//     public String getTitle();
// 
//     public int getForumId();
// 
//     public int getParentId();
// 
//     public String getForumSlug();
// 
//     public boolean isSubscribed();
// 
//     public void setSubscribed(boolean subs);
// 
//     public String getImageUrl();
// 
//     public boolean hasChildren();
// 
//     public String getWebUri();
// 
//     public boolean canContainThreads();
// }
// 
// Path: android/src/main/java/com/xda/one/util/Utils.java
// public class Utils {
// 
//     public static String handleRetrofitErrorQuietly(final RetrofitError error) {
//         error.printStackTrace();
// 
//         InputStream inputStream = null;
//         try {
//             if (error.isNetworkError()) {
//                 Log.e("XDA-ONE", "Network error happened.");
//             } else {
//                 final TypedInput body = error.getResponse().getBody();
//                 if (body == null) {
//                     Log.e("XDA-ONE", "Unable to retrieve body");
//                     return null;
//                 }
//                 inputStream = body.in();
// 
//                 final String result = IOUtils.toString(inputStream);
//                 Log.e("XDA-ONE", result);
//                 return result;
//             }
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             IOUtils.closeQuietly(inputStream);
//         }
//         return null;
//     }
// 
//     public static <T> int getCollectionSize(final Collection<T> collection) {
//         return collection == null ? 0 : collection.size();
//     }
// 
//     public static boolean isCollectionEmpty(final Collection collection) {
//         return collection == null || collection.isEmpty();
//     }
// 
//     public static CharSequence getRelativeDate(final Context context, final long dateline) {
//         return DateUtils.getRelativeDateTimeString(context, dateline,
//                 DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS,
//                 DateUtils.FORMAT_NUMERIC_DATE);
//     }
// }


// Path: android/src/main/java/com/xda/one/ui/ForumAdapter.java
import com.xda.one.R;
import com.xda.one.api.model.interfaces.Forum;
import com.xda.one.ui.helper.ActionModeHelper;
import com.xda.one.util.Utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;

package com.xda.one.ui;




public class ForumAdapter<T extends Forum>
        extends RecyclerView.Adapter<ForumAdapter.ForumViewHolder> {

    private final LayoutInflater mLayoutInflater;

    private final List<T> mForums;

    private final View.OnClickListener mListener;

    private final View.OnLongClickListener mLongClickListener;

    private final ActionModeHelper mModeHelper;

    private final ImageViewDeviceDelegate mImageViewDeviceDelegate;

    private final SubscribeButtonDelegate mSubscribeButtonDelegate;

    public ForumAdapter(final Context context, final View.OnClickListener listener,
            final View.OnLongClickListener longClickListener,
            final ActionModeHelper modeHelper,
            final ImageViewDeviceDelegate imageViewDeviceDelegate,
            final SubscribeButtonDelegate buttonDelegate) {
        mLayoutInflater = LayoutInflater.from(context);