// Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
// 
//     public abstract long id();
// 
//     public abstract String name();
// 
//     public abstract String username();
// 
//     public abstract String html_url();
// 
//     public abstract String avatar_url();
// 
//     public abstract String bio();
// 
//     @Nullable
//     public abstract String location();
// 
//     public abstract Links links();
// 
//     public abstract long buckets_count();
// 
//     public abstract long comments_received_count();
// 
//     public abstract long followers_count();
// 
//     public abstract long followings_count();
// 
//     public abstract long likes_count();
// 
//     public abstract long likes_received_count();
// 
//     public abstract long projects_count();
// 
//     public abstract long rebounds_received_count();
// 
//     public abstract long shots_count();
// 
//     public abstract long teams_count();
// 
//     public abstract boolean can_upload_shot();
// 
//     public abstract String type();
// 
//     public abstract boolean pro();
// 
//     public abstract String buckets_url();
// 
//     public abstract String followers_url();
// 
//     public abstract String following_url();
// 
//     public abstract String likes_url();
// 
//     public abstract String shots_url();
// 
//     @Nullable
//     public abstract String teams_url();
// 
//     public abstract String created_at();
// 
//     public abstract String updated_at();
// 
//     public static TypeAdapter<User> typeAdapter(Gson gson) {
//         return new AutoValue_User.GsonTypeAdapter(gson).nullSafe();
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
// 
//     private static AccountManager accountManager = new AccountManager();
//     private AccessToken accessToken;
//     private User me;
// 
//     private AccountManager() {
//     }
// 
//     public static AccountManager getInstance() {
//         return accountManager;
//     }
// 
//     public AccessToken getAccessToken() {
//         return accessToken;
//     }
// 
//     public void setAccessToken(AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     public void setAccessToken(String token) {
//         accessToken = new GsonBuilder()
//                 .registerTypeAdapterFactory(ProteinAdapterFactory.create())
//                 .create()
//                 .fromJson(token, AccessToken.class);
//     }
// 
//     public boolean isLogin() {
//         return accessToken != null;
//     }
// 
//     public User getMe() {
//         return me;
//     }
// 
//     public void setMe(User me) {
//         this.me = me;
//     }
// 
//     public void clear() {
//         accessToken = null;
//         me = null;
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/RxUtils.java
// public class RxUtils {
// 
//     public static final int WINDOW_DURATION = 500;
//     public static final TimeUnit TIME_UNIT = TimeUnit.MILLISECONDS;
// 
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.ge.protein.R;
import com.ge.protein.data.model.User;
import com.ge.protein.util.AccountManager;
import com.ge.protein.util.RxUtils;
import com.jakewharton.rxbinding2.view.RxView;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;
import static com.bumptech.glide.request.RequestOptions.placeholderOf;
            }
            return false;
        });

        viewPager.setAdapter(new MainPagerAdapter(((FragmentActivity) getContext()).getSupportFragmentManager()));

        // Add 4 tabs for TabLayout
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_popular)); // Popular
        if (AccountManager.getInstance().isLogin()) {
            tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_following)); // Following
        }
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_recent)); // Recent
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_debuts)); // Debuts

        // Setup sync between TabLayout and ViewPager
        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
        tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
        viewPager.setOffscreenPageLimit(3);
    }

    @Override
    public void setDefaultUserInfo() {
        Glide.with(getContext())
                .load(R.mipmap.ic_launcher)
                .transition(withCrossFade())
                .into(userAvatar);
        setUserName(getContext().getString(R.string.action_login));
    }

    @Override
// Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
// 
//     public abstract long id();
// 
//     public abstract String name();
// 
//     public abstract String username();
// 
//     public abstract String html_url();
// 
//     public abstract String avatar_url();
// 
//     public abstract String bio();
// 
//     @Nullable
//     public abstract String location();
// 
//     public abstract Links links();
// 
//     public abstract long buckets_count();
// 
//     public abstract long comments_received_count();
// 
//     public abstract long followers_count();
// 
//     public abstract long followings_count();
// 
//     public abstract long likes_count();
// 
//     public abstract long likes_received_count();
// 
//     public abstract long projects_count();
// 
//     public abstract long rebounds_received_count();
// 
//     public abstract long shots_count();
// 
//     public abstract long teams_count();
// 
//     public abstract boolean can_upload_shot();
// 
//     public abstract String type();
// 
//     public abstract boolean pro();
// 
//     public abstract String buckets_url();
// 
//     public abstract String followers_url();
// 
//     public abstract String following_url();
// 
//     public abstract String likes_url();
// 
//     public abstract String shots_url();
// 
//     @Nullable
//     public abstract String teams_url();
// 
//     public abstract String created_at();
// 
//     public abstract String updated_at();
// 
//     public static TypeAdapter<User> typeAdapter(Gson gson) {
//         return new AutoValue_User.GsonTypeAdapter(gson).nullSafe();
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
// 
//     private static AccountManager accountManager = new AccountManager();
//     private AccessToken accessToken;
//     private User me;
// 
//     private AccountManager() {
//     }
// 
//     public static AccountManager getInstance() {
//         return accountManager;
//     }
// 
//     public AccessToken getAccessToken() {
//         return accessToken;
//     }
// 
//     public void setAccessToken(AccessToken accessToken) {
//         this.accessToken = accessToken;
//     }
// 
//     public void setAccessToken(String token) {
//         accessToken = new GsonBuilder()
//                 .registerTypeAdapterFactory(ProteinAdapterFactory.create())
//                 .create()
//                 .fromJson(token, AccessToken.class);
//     }
// 
//     public boolean isLogin() {
//         return accessToken != null;
//     }
// 
//     public User getMe() {
//         return me;
//     }
// 
//     public void setMe(User me) {
//         this.me = me;
//     }
// 
//     public void clear() {
//         accessToken = null;
//         me = null;
//     }
// }
// 
// Path: app/src/main/java/com/ge/protein/util/RxUtils.java
// public class RxUtils {
// 
//     public static final int WINDOW_DURATION = 500;
//     public static final TimeUnit TIME_UNIT = TimeUnit.MILLISECONDS;
// 
// }


// Path: app/src/main/java/com/ge/protein/main/MainView.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.ge.protein.R;
import com.ge.protein.data.model.User;
import com.ge.protein.util.AccountManager;
import com.ge.protein.util.RxUtils;
import com.jakewharton.rxbinding2.view.RxView;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;
import static com.bumptech.glide.request.RequestOptions.placeholderOf;

            }
            return false;
        });

        viewPager.setAdapter(new MainPagerAdapter(((FragmentActivity) getContext()).getSupportFragmentManager()));

        // Add 4 tabs for TabLayout
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_popular)); // Popular
        if (AccountManager.getInstance().isLogin()) {
            tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_following)); // Following
        }
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_recent)); // Recent
        tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_debuts)); // Debuts

        // Setup sync between TabLayout and ViewPager
        viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
        tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager));
        viewPager.setOffscreenPageLimit(3);
    }

    @Override
    public void setDefaultUserInfo() {
        Glide.with(getContext())
                .load(R.mipmap.ic_launcher)
                .transition(withCrossFade())
                .into(userAvatar);
        setUserName(getContext().getString(R.string.action_login));
    }

    @Override
    public void setUserInfo(User user) {