// Path: app/src/main/java/fr/guddy/androidstarter/persistence/entities/RepoEntity.java
// @Mappable(with = DTORepo.class)
// @DatabaseTable(tableName = "REPO", daoClass = DAORepo.class)
// public class RepoEntity extends AbstractOrmLiteEntity implements Serializable {
//     @Mapped
//     @DatabaseField
//     public Integer id;
// 
//     @Mapped
//     @DatabaseField
//     public String name;
// 
//     @Mapped
//     @DatabaseField
//     public String description;
// 
//     @Mapped
//     @DatabaseField
//     public String url;
// 
//     @DatabaseField
//     public String avatarUrl;
// }


import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.hannesdorfmann.mosby.mvp.viewstate.MvpViewStateFragment;
import com.hannesdorfmann.mosby.mvp.viewstate.ViewState;
import com.orhanobut.logger.Logger;
import java.util.List;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import fr.guddy.androidstarter.BuildConfig;
import fr.guddy.androidstarter.R;
import fr.guddy.androidstarter.persistence.entities.RepoEntity;
import hugo.weaving.DebugLog;
import icepick.Icepick;
import io.nlopez.smartadapters.SmartAdapter;
import io.nlopez.smartadapters.utils.ViewEventListener;
import pl.aprilapps.switcher.Switcher;

    public void showLoading(final boolean pbPullToRefresh) {
        if (!pbPullToRefresh) {
            mSwitcher.showProgressView();
        }
    }

    @DebugLog
    @Override
    public void showContent() {
        ButterKnife.apply(mSwipeRefreshLayouts, STOP_REFRESHING);
        mSwitcher.showContentView();
    }

    @DebugLog
    @Override
    public void showError(final Throwable poThrowable, final boolean pbPullToRefresh) {
        if (BuildConfig.DEBUG && DEBUG) {
            Logger.t(TAG).e(poThrowable, "");
        }

        ButterKnife.apply(mSwipeRefreshLayouts, STOP_REFRESHING);
        mSwitcher.showErrorView();
    }

    @DebugLog
    @Override
    public void setData(final RepoListMvp.Model poData) {
        ((RepoListMvp.ViewState) viewState).data = poData;

        SmartAdapter.items(poData.repos)

// Path: app/src/main/java/fr/guddy/androidstarter/persistence/entities/RepoEntity.java
// @Mappable(with = DTORepo.class)
// @DatabaseTable(tableName = "REPO", daoClass = DAORepo.class)
// public class RepoEntity extends AbstractOrmLiteEntity implements Serializable {
//     @Mapped
//     @DatabaseField
//     public Integer id;
// 
//     @Mapped
//     @DatabaseField
//     public String name;
// 
//     @Mapped
//     @DatabaseField
//     public String description;
// 
//     @Mapped
//     @DatabaseField
//     public String url;
// 
//     @DatabaseField
//     public String avatarUrl;
// }


// Path: app/src/main/java/fr/guddy/androidstarter/mvp/repo_list/FragmentRepoList.java
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.hannesdorfmann.mosby.mvp.viewstate.MvpViewStateFragment;
import com.hannesdorfmann.mosby.mvp.viewstate.ViewState;
import com.orhanobut.logger.Logger;
import java.util.List;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import fr.guddy.androidstarter.BuildConfig;
import fr.guddy.androidstarter.R;
import fr.guddy.androidstarter.persistence.entities.RepoEntity;
import hugo.weaving.DebugLog;
import icepick.Icepick;
import io.nlopez.smartadapters.SmartAdapter;
import io.nlopez.smartadapters.utils.ViewEventListener;
import pl.aprilapps.switcher.Switcher;

    public void showLoading(final boolean pbPullToRefresh) {
        if (!pbPullToRefresh) {
            mSwitcher.showProgressView();
        }
    }

    @DebugLog
    @Override
    public void showContent() {
        ButterKnife.apply(mSwipeRefreshLayouts, STOP_REFRESHING);
        mSwitcher.showContentView();
    }

    @DebugLog
    @Override
    public void showError(final Throwable poThrowable, final boolean pbPullToRefresh) {
        if (BuildConfig.DEBUG && DEBUG) {
            Logger.t(TAG).e(poThrowable, "");
        }

        ButterKnife.apply(mSwipeRefreshLayouts, STOP_REFRESHING);
        mSwitcher.showErrorView();
    }

    @DebugLog
    @Override
    public void setData(final RepoListMvp.Model poData) {
        ((RepoListMvp.ViewState) viewState).data = poData;

        SmartAdapter.items(poData.repos)

                .map(RepoEntity.class, CellRepo.class)
