// Path: app/src/main/java/com/quinn/githubknife/interactor/RepoAndEventPreviewInteractor.java
// public interface RepoAndEventPreviewInteractor {
// 
//     public void previewRepo(int page,String user);
//     public void previewEvent(int page,String user);
// 
// 
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/interactor/RepoAndEventPreviewInteractorImpl.java
// public class RepoAndEventPreviewInteractorImpl implements  RepoAndEventPreviewInteractor {
// 
//     private Context context;
//     private OnLoadRepoAndEventPreviewListener listener;
//     private GithubService service;
//     private GitHubAccount gitHubAccount;
// 
// 
//     public RepoAndEventPreviewInteractorImpl(final Context context, final OnLoadRepoAndEventPreviewListener listener){
//         this.context = context;
//         this.listener = listener;
//         this.service = RetrofitUtil.getJsonRetrofitInstance(context).create(GithubService.class);
//         this.gitHubAccount = GitHubAccount.getInstance(context);
//     }
// 
// 
//     @Override
//     public void previewRepo(final int page, final String user) {
//         Call<List<Repository>> call = service.userRepo(user, String.valueOf(page));
//         call.enqueue(new Callback<List<Repository>>() {
//             @Override
//             public void onResponse(Response<List<Repository>> response, Retrofit retrofit) {
//                 RetrofitUtil.printResponse(response);
//                 if (response.code() == 401) {
//                     gitHubAccount.invalidateToken(RetrofitUtil.token);
//                     previewRepo(page, user);
//                 } else if (response.isSuccess()) {
//                     listener.repoItems(response.body());
//                 } else {
//                     listener.loadRepoError();
//                 }
//             }
//             @Override
//             public void onFailure(Throwable t) {
//                 listener.loadRepoError();
//             }
//         });
//     }
// 
//     @Override
//     public void previewEvent(int page, String user) {
// 
//     }
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/listener/OnLoadRepoAndEventPreviewListener.java
// public interface OnLoadRepoAndEventPreviewListener {
// 
//     public void repoItems(List items);
//     public void eventItems(List items);
// 
//     public void loadRepoError();
//     public void loadEventError();
// 
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/view/RepoAndEventPreviewView.java
// public interface RepoAndEventPreviewView {
// 
//     public void repoItems(List items);
//     public void eventItems(List items);
// 
//     public void loadRepoError();
//     public void loadEventError();
// 
// 
// }


import android.content.Context;
import com.quinn.githubknife.interactor.RepoAndEventPreviewInteractor;
import com.quinn.githubknife.interactor.RepoAndEventPreviewInteractorImpl;
import com.quinn.githubknife.listener.OnLoadRepoAndEventPreviewListener;
import com.quinn.githubknife.view.RepoAndEventPreviewView;
import java.util.List;
package com.quinn.githubknife.presenter;




/**
 * Created by Quinn on 10/16/15.
 */
public class RepoAndEventPreviewPresenterImpl implements RepoAndEventPreviewPresenter,OnLoadRepoAndEventPreviewListener {


    private Context context;
    private RepoAndEventPreviewView view;
    private RepoAndEventPreviewInteractor interactor;


// Path: app/src/main/java/com/quinn/githubknife/interactor/RepoAndEventPreviewInteractor.java
// public interface RepoAndEventPreviewInteractor {
// 
//     public void previewRepo(int page,String user);
//     public void previewEvent(int page,String user);
// 
// 
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/interactor/RepoAndEventPreviewInteractorImpl.java
// public class RepoAndEventPreviewInteractorImpl implements  RepoAndEventPreviewInteractor {
// 
//     private Context context;
//     private OnLoadRepoAndEventPreviewListener listener;
//     private GithubService service;
//     private GitHubAccount gitHubAccount;
// 
// 
//     public RepoAndEventPreviewInteractorImpl(final Context context, final OnLoadRepoAndEventPreviewListener listener){
//         this.context = context;
//         this.listener = listener;
//         this.service = RetrofitUtil.getJsonRetrofitInstance(context).create(GithubService.class);
//         this.gitHubAccount = GitHubAccount.getInstance(context);
//     }
// 
// 
//     @Override
//     public void previewRepo(final int page, final String user) {
//         Call<List<Repository>> call = service.userRepo(user, String.valueOf(page));
//         call.enqueue(new Callback<List<Repository>>() {
//             @Override
//             public void onResponse(Response<List<Repository>> response, Retrofit retrofit) {
//                 RetrofitUtil.printResponse(response);
//                 if (response.code() == 401) {
//                     gitHubAccount.invalidateToken(RetrofitUtil.token);
//                     previewRepo(page, user);
//                 } else if (response.isSuccess()) {
//                     listener.repoItems(response.body());
//                 } else {
//                     listener.loadRepoError();
//                 }
//             }
//             @Override
//             public void onFailure(Throwable t) {
//                 listener.loadRepoError();
//             }
//         });
//     }
// 
//     @Override
//     public void previewEvent(int page, String user) {
// 
//     }
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/listener/OnLoadRepoAndEventPreviewListener.java
// public interface OnLoadRepoAndEventPreviewListener {
// 
//     public void repoItems(List items);
//     public void eventItems(List items);
// 
//     public void loadRepoError();
//     public void loadEventError();
// 
// }
// 
// Path: app/src/main/java/com/quinn/githubknife/view/RepoAndEventPreviewView.java
// public interface RepoAndEventPreviewView {
// 
//     public void repoItems(List items);
//     public void eventItems(List items);
// 
//     public void loadRepoError();
//     public void loadEventError();
// 
// 
// }


// Path: app/src/main/java/com/quinn/githubknife/presenter/RepoAndEventPreviewPresenterImpl.java
import android.content.Context;
import com.quinn.githubknife.interactor.RepoAndEventPreviewInteractor;
import com.quinn.githubknife.interactor.RepoAndEventPreviewInteractorImpl;
import com.quinn.githubknife.listener.OnLoadRepoAndEventPreviewListener;
import com.quinn.githubknife.view.RepoAndEventPreviewView;
import java.util.List;

package com.quinn.githubknife.presenter;




/**
 * Created by Quinn on 10/16/15.
 */
public class RepoAndEventPreviewPresenterImpl implements RepoAndEventPreviewPresenter,OnLoadRepoAndEventPreviewListener {


    private Context context;
    private RepoAndEventPreviewView view;
    private RepoAndEventPreviewInteractor interactor;


    public RepoAndEventPreviewPresenterImpl(Context context, RepoAndEventPreviewView view){