// 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/api/model/response/ResponseUserProfile.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class ResponseUserProfile {
// 
//     private final ResponseAvatar mResponseAvatar = new ResponseAvatar();
// 
//     @JsonProperty("userid")
//     private String mUserId;
// 
//     @JsonProperty("signature")
//     private String mSignature;
// 
//     @JsonProperty("username")
//     private String mUserName;
// 
//     @JsonProperty("usertitle")
//     private String mUserTitle;
// 
//     @JsonProperty("posts")
//     private int mPosts;
// 
//     @JsonProperty("post_thanks_thanked_posts")
//     private int mThankedPosts;
// 
//     @JsonProperty("post_thanks_thanked_times")
//     private int mThankedTimes;
// 
//     @JsonProperty("devices")
//     private List<ResponseUserProfileDevice> mDevices;
// 
//     @JsonProperty("email")
//     private String mEmail;
// 
//     @JsonProperty("notifications")
//     private ResponseUserProfileNotificationContainer mNotifications;
// 
//     private CharSequence mParsedSignature;
// 
//     public CharSequence getParsedSignature() {
//         return mParsedSignature;
//     }
// 
//     public void setParsedSignature(final CharSequence parsedSignature) {
//         mParsedSignature = parsedSignature;
//     }
// 
//     public String getUserId() {
//         return mUserId;
//     }
// 
//     public String getSignature() {
//         return mSignature;
//     }
// 
//     public String getUserName() {
//         return mUserName;
//     }
// 
//     public String getUserTitle() {
//         return mUserTitle;
//     }
// 
//     public int getPosts() {
//         return mPosts;
//     }
// 
//     public int getThankedPosts() {
//         return mThankedPosts;
//     }
// 
//     public int getThankedTimes() {
//         return mThankedTimes;
//     }
// 
//     public List<ResponseUserProfileDevice> getDevices() {
//         return mDevices;
//     }
// 
//     public String getEmail() {
//         return mEmail;
//     }
// 
//     public ResponseUserProfileNotificationContainer getNotifications() {
//         return mNotifications;
//     }
// 
//     // Delegate methods
//     public String getAvatarUrl() {
//         return mResponseAvatar.getAvatarUrl();
//     }
// 
//     @JsonProperty(value = "avatar_url")
//     public void setAvatarUrl(final String avatarUrl) {
//         mResponseAvatar.setAvatarUrl(avatarUrl);
//     }
// }
// 
// Path: android/src/main/java/android/support/v7/widget/XDALinerLayoutManager.java
// public class XDALinerLayoutManager extends LinearLayoutManager {
// 
//     private boolean mListEnd = true;
// 
//     public XDALinerLayoutManager(final Context context) {
//         super(context);
//     }
// 
//     public XDALinerLayoutManager(final Context context, final int orientation,
//             final boolean reverseLayout) {
//         super(context, orientation, reverseLayout);
//     }
// 
//     @Override
//     int scrollBy(final int dy, final RecyclerView.Recycler recycler,
//             final RecyclerView.State state) {
//         int scrolled = super.scrollBy(dy, recycler, state);
//         mListEnd = dy > 0 && dy > scrolled;
//         return scrolled;
//     }
// 
//     public boolean isListEnd() {
//         return mListEnd;
//     }
// }


import com.squareup.picasso.Picasso;
import com.xda.one.R;
import com.xda.one.api.model.interfaces.Forum;
import com.xda.one.api.model.response.ResponseUserProfile;
import com.xda.one.loader.UserProfileLoader;
import com.xda.one.ui.helper.ActionModeHelper;
import com.xda.one.util.FragmentUtils;
import com.xda.one.util.UIUtils;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.XDALinerLayoutManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.ArrayList;
import java.util.List;
package com.xda.one.ui;




public class MyDeviceFragment extends Fragment
        implements LoaderManager.LoaderCallbacks<ResponseUserProfile> {

    private ActionModeHelper mModeHelper;

    private RecyclerView mRecyclerView;

    private ForumAdapter<Forum> mAdapter;

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mModeHelper = new ActionModeHelper(getActivity(),
                new ActionModeCallback(), new ClickListener(),
                ActionModeHelper.SelectionMode.SINGLE);
        mAdapter = new ForumAdapter<>(getActivity(), mModeHelper, mModeHelper, mModeHelper,
                new ImageViewDeviceDelegate(), new SubscribeButtonDelegate());
    }

    @Override
    public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
            @Nullable final Bundle savedInstanceState) {
        return inflater.inflate(R.layout.my_device_fragment, container, false);
    }

    @Override
    public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mRecyclerView = (RecyclerView) view.findViewById(android.R.id.list);
        mRecyclerView.setLayoutManager(new XDALinerLayoutManager(getActivity()));
// 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/api/model/response/ResponseUserProfile.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class ResponseUserProfile {
// 
//     private final ResponseAvatar mResponseAvatar = new ResponseAvatar();
// 
//     @JsonProperty("userid")
//     private String mUserId;
// 
//     @JsonProperty("signature")
//     private String mSignature;
// 
//     @JsonProperty("username")
//     private String mUserName;
// 
//     @JsonProperty("usertitle")
//     private String mUserTitle;
// 
//     @JsonProperty("posts")
//     private int mPosts;
// 
//     @JsonProperty("post_thanks_thanked_posts")
//     private int mThankedPosts;
// 
//     @JsonProperty("post_thanks_thanked_times")
//     private int mThankedTimes;
// 
//     @JsonProperty("devices")
//     private List<ResponseUserProfileDevice> mDevices;
// 
//     @JsonProperty("email")
//     private String mEmail;
// 
//     @JsonProperty("notifications")
//     private ResponseUserProfileNotificationContainer mNotifications;
// 
//     private CharSequence mParsedSignature;
// 
//     public CharSequence getParsedSignature() {
//         return mParsedSignature;
//     }
// 
//     public void setParsedSignature(final CharSequence parsedSignature) {
//         mParsedSignature = parsedSignature;
//     }
// 
//     public String getUserId() {
//         return mUserId;
//     }
// 
//     public String getSignature() {
//         return mSignature;
//     }
// 
//     public String getUserName() {
//         return mUserName;
//     }
// 
//     public String getUserTitle() {
//         return mUserTitle;
//     }
// 
//     public int getPosts() {
//         return mPosts;
//     }
// 
//     public int getThankedPosts() {
//         return mThankedPosts;
//     }
// 
//     public int getThankedTimes() {
//         return mThankedTimes;
//     }
// 
//     public List<ResponseUserProfileDevice> getDevices() {
//         return mDevices;
//     }
// 
//     public String getEmail() {
//         return mEmail;
//     }
// 
//     public ResponseUserProfileNotificationContainer getNotifications() {
//         return mNotifications;
//     }
// 
//     // Delegate methods
//     public String getAvatarUrl() {
//         return mResponseAvatar.getAvatarUrl();
//     }
// 
//     @JsonProperty(value = "avatar_url")
//     public void setAvatarUrl(final String avatarUrl) {
//         mResponseAvatar.setAvatarUrl(avatarUrl);
//     }
// }
// 
// Path: android/src/main/java/android/support/v7/widget/XDALinerLayoutManager.java
// public class XDALinerLayoutManager extends LinearLayoutManager {
// 
//     private boolean mListEnd = true;
// 
//     public XDALinerLayoutManager(final Context context) {
//         super(context);
//     }
// 
//     public XDALinerLayoutManager(final Context context, final int orientation,
//             final boolean reverseLayout) {
//         super(context, orientation, reverseLayout);
//     }
// 
//     @Override
//     int scrollBy(final int dy, final RecyclerView.Recycler recycler,
//             final RecyclerView.State state) {
//         int scrolled = super.scrollBy(dy, recycler, state);
//         mListEnd = dy > 0 && dy > scrolled;
//         return scrolled;
//     }
// 
//     public boolean isListEnd() {
//         return mListEnd;
//     }
// }


// Path: android/src/main/java/com/xda/one/ui/MyDeviceFragment.java
import com.squareup.picasso.Picasso;
import com.xda.one.R;
import com.xda.one.api.model.interfaces.Forum;
import com.xda.one.api.model.response.ResponseUserProfile;
import com.xda.one.loader.UserProfileLoader;
import com.xda.one.ui.helper.ActionModeHelper;
import com.xda.one.util.FragmentUtils;
import com.xda.one.util.UIUtils;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.XDALinerLayoutManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import java.util.ArrayList;
import java.util.List;

package com.xda.one.ui;




public class MyDeviceFragment extends Fragment
        implements LoaderManager.LoaderCallbacks<ResponseUserProfile> {

    private ActionModeHelper mModeHelper;

    private RecyclerView mRecyclerView;

    private ForumAdapter<Forum> mAdapter;

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mModeHelper = new ActionModeHelper(getActivity(),
                new ActionModeCallback(), new ClickListener(),
                ActionModeHelper.SelectionMode.SINGLE);
        mAdapter = new ForumAdapter<>(getActivity(), mModeHelper, mModeHelper, mModeHelper,
                new ImageViewDeviceDelegate(), new SubscribeButtonDelegate());
    }

    @Override
    public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
            @Nullable final Bundle savedInstanceState) {
        return inflater.inflate(R.layout.my_device_fragment, container, false);
    }

    @Override
    public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mRecyclerView = (RecyclerView) view.findViewById(android.R.id.list);
        mRecyclerView.setLayoutManager(new XDALinerLayoutManager(getActivity()));
        mRecyclerView.setAdapter(mAdapter);