// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/api/TeamApi.java
// @EBean public class TeamApi implements ITeamApi {
// 
//   @Bean(Api.class) IApi api;
//   @Bean(PlayerApi.class) IPlayerApi playerApi;
//   @Bean(TeamRepository.class) ITeamRepository teamRepository;
// 
//   @Override public void get(final Context context, String team, final RecyclerView recyclerView) {
//     String urlFull = ApiConstraints.TEAM.concat(team);
//     api.getArray(urlFull).setCallback(new FutureCallback<Response<JsonArray>>() {
//       @Override public void onCompleted(Exception e, Response<JsonArray> result) {
//         if (e != null) {
//           return;
//         }
//         int code = result.getHeaders().code();
//         switch (code) {
//           case 200:
//             Gson gson = new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT).create();
//             TypeToken listType = new TypeToken<List<Team>>() {
//             };
//             List<Team> teams = (List<Team>) gson.fromJson(result.getResult(), listType.getType());
//             SearchTeamAdapter teamAdapter = new SearchTeamAdapter(context, teams, teamRepository);
//             recyclerView.setAdapter(teamAdapter);
//             break;
//           case 404:
//             break;
//         }
//       }
//     });
//   }
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/api/contracts/ITeamApi.java
// public interface ITeamApi {
// 
//   void get(Context context, String team, RecyclerView recyclerView);
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/contracts/ITeamRepository.java
// public interface ITeamRepository extends ICrud<Team> {
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/repositories/TeamRepository.java
// @EBean public class TeamRepository implements ITeamRepository {
// 
//   @Override public List<Team> get() {
//     try {
//       return new Select().from(Team.class).execute();
//     } catch (Exception e) {
//       return Collections.emptyList();
//     }
//   }
// 
//   @Override public Team getById(long id) {
//     try {
//       return new Select().from(Team.class).where("TeamId = ?", id).executeSingle();
//     } catch (Exception e) {
//       return null;
//     }
//   }
// 
//   @Override public long create(Team item) {
//     try {
//       return item.save();
//     } catch (Exception e) {
//       e.printStackTrace();
//       return 0;
//     }
//   }
// 
//   @Override public boolean update(Team item) {
//     try {
//       return item.save() > 0;
//     } catch (Exception e) {
//       e.printStackTrace();
//       return false;
//     }
//   }
// 
//   @Override public boolean delete(long id) {
//     try {
//       new Delete().from(Team.class).where("TeamId = ?", id).executeSingle();
//       return true;
//     } catch (Exception e) {
//       e.printStackTrace();
//       return false;
//     }
//   }
// }


import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.RelativeLayout;
import com.github.pierry.cartolapp.MainActivity_;
import com.github.pierry.cartolapp.R;
import com.github.pierry.cartolapp.api.TeamApi;
import com.github.pierry.cartolapp.api.contracts.ITeamApi;
import com.github.pierry.cartolapp.domain.contracts.ITeamRepository;
import com.github.pierry.cartolapp.repositories.TeamRepository;
import com.github.pierry.fitloader.RotateLoading;
import com.rengwuxian.materialedittext.MaterialEditText;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
package com.github.pierry.cartolapp.ui;


@EActivity(R.layout.activity_team_search) public class SearchTeamActivity
    extends AppCompatActivity {

  @ViewById RecyclerView recyclerView;
  @ViewById RelativeLayout body;
  @ViewById RotateLoading rotateLoading;
  @ViewById MaterialEditText teamRequest;
  @ViewById Toolbar toolbar;

// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/api/TeamApi.java
// @EBean public class TeamApi implements ITeamApi {
// 
//   @Bean(Api.class) IApi api;
//   @Bean(PlayerApi.class) IPlayerApi playerApi;
//   @Bean(TeamRepository.class) ITeamRepository teamRepository;
// 
//   @Override public void get(final Context context, String team, final RecyclerView recyclerView) {
//     String urlFull = ApiConstraints.TEAM.concat(team);
//     api.getArray(urlFull).setCallback(new FutureCallback<Response<JsonArray>>() {
//       @Override public void onCompleted(Exception e, Response<JsonArray> result) {
//         if (e != null) {
//           return;
//         }
//         int code = result.getHeaders().code();
//         switch (code) {
//           case 200:
//             Gson gson = new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT).create();
//             TypeToken listType = new TypeToken<List<Team>>() {
//             };
//             List<Team> teams = (List<Team>) gson.fromJson(result.getResult(), listType.getType());
//             SearchTeamAdapter teamAdapter = new SearchTeamAdapter(context, teams, teamRepository);
//             recyclerView.setAdapter(teamAdapter);
//             break;
//           case 404:
//             break;
//         }
//       }
//     });
//   }
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/api/contracts/ITeamApi.java
// public interface ITeamApi {
// 
//   void get(Context context, String team, RecyclerView recyclerView);
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/domain/contracts/ITeamRepository.java
// public interface ITeamRepository extends ICrud<Team> {
// }
// 
// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/repositories/TeamRepository.java
// @EBean public class TeamRepository implements ITeamRepository {
// 
//   @Override public List<Team> get() {
//     try {
//       return new Select().from(Team.class).execute();
//     } catch (Exception e) {
//       return Collections.emptyList();
//     }
//   }
// 
//   @Override public Team getById(long id) {
//     try {
//       return new Select().from(Team.class).where("TeamId = ?", id).executeSingle();
//     } catch (Exception e) {
//       return null;
//     }
//   }
// 
//   @Override public long create(Team item) {
//     try {
//       return item.save();
//     } catch (Exception e) {
//       e.printStackTrace();
//       return 0;
//     }
//   }
// 
//   @Override public boolean update(Team item) {
//     try {
//       return item.save() > 0;
//     } catch (Exception e) {
//       e.printStackTrace();
//       return false;
//     }
//   }
// 
//   @Override public boolean delete(long id) {
//     try {
//       new Delete().from(Team.class).where("TeamId = ?", id).executeSingle();
//       return true;
//     } catch (Exception e) {
//       e.printStackTrace();
//       return false;
//     }
//   }
// }


// Path: cartolapp/app/src/main/java/com/github/pierry/cartolapp/ui/SearchTeamActivity.java
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.RelativeLayout;
import com.github.pierry.cartolapp.MainActivity_;
import com.github.pierry.cartolapp.R;
import com.github.pierry.cartolapp.api.TeamApi;
import com.github.pierry.cartolapp.api.contracts.ITeamApi;
import com.github.pierry.cartolapp.domain.contracts.ITeamRepository;
import com.github.pierry.cartolapp.repositories.TeamRepository;
import com.github.pierry.fitloader.RotateLoading;
import com.rengwuxian.materialedittext.MaterialEditText;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.OptionsItem;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;

package com.github.pierry.cartolapp.ui;


@EActivity(R.layout.activity_team_search) public class SearchTeamActivity
    extends AppCompatActivity {

  @ViewById RecyclerView recyclerView;
  @ViewById RelativeLayout body;
  @ViewById RotateLoading rotateLoading;
  @ViewById MaterialEditText teamRequest;
  @ViewById Toolbar toolbar;

  @Bean(TeamApi.class) ITeamApi teamApi;