// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/domain/events/ErrorEvent.java
// public class ErrorEvent {
// 
//     public static final int ACTION_NO_ACTION = 0;
//     public static final int ACTION_REDIRECT_TO_LOGIN = 1;
//     public static final int ACTIONS_REQUEST_NEW_SCOPES = 2;
//     public static Exception exception;
// 
//     private String message;
//     private int action = ACTION_NO_ACTION;
// 
//     public ErrorEvent() {}
// 
//     public ErrorEvent(Exception exception) {
//         this.exception = exception;
//         this.message = exception.getMessage();
//     }
// 
//     public ErrorEvent(Exception exception, int action) {
//         this.exception = exception;
//         this.message = exception.getMessage();
//         this.action = action;
//     }
// 
//     public ErrorEvent(String message) {
//         this.message = message;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     public int getAction() { return action; }
// 
//     public void setAction(int action) { this.action = action; }
// 
//     public static Exception getException() {
//         return exception;
//     }
// 
//     public static void setException(Exception exception) {
//         ErrorEvent.exception = exception;
//     }
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/domain/model/Player.java
// public class Player implements Serializable {
//     private long id;
//     private String name = "";
//     private int level = 0;
//     private int sex = 0;
//     private int position = 0;
//     private String comment = "";
// 
//     public long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getLevel() {
//         return level;
//     }
// 
//     public void setLevel(int level) {
//         this.level = level;
//     }
// 
//     public int getSex() {
//         return sex;
//     }
// 
//     public void setSex(int sex) {
//         this.sex = sex;
//     }
// 
//     public int getPosition() {
//         return position;
//     }
// 
//     public void setPosition(int position) {
//         this.position = position;
//     }
// 
//     public String getComment() {
//         return comment;
//     }
// 
//     public void setComment(String comment) {
//         this.comment = comment;
//     }
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/view/fragment/BaseFragment.java
// public abstract class BaseFragment extends Fragment {
// 
//     @Override
//     public void onViewCreated(View view, Bundle savedInstanceState) {
//         super.onViewCreated(view, savedInstanceState);
//         ButterKnife.bind(this, view);
//     }
// 
//     public abstract boolean showError(ErrorEvent event);
// 
//     @Override
//     public void onResume() {
//         super.onResume();
//     }
// 
//     @SuppressWarnings("unchecked")
//     protected <C> C getComponent(Class<C> componentType) {
//         return componentType.cast(((HasComponent<C>) getActivity()).getComponent());
//     }
// 
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/editplayer/view/controller/PrepareEditPlayerController.java
// public class PrepareEditPlayerController {
// 
//     private CreatePlayer job;
//     private View view;
// 
//     public void setView(View view) {
//         this.view = view;
//     }
// 
//     @Inject
//     public PrepareEditPlayerController(CreatePlayer createPlayer){
//         this.job = createPlayer;
//     }
// 
//     public void getPlayer(){
//         view.findPlayerComplete(new Player());
//     }
// 
//     public void createPlayer(final Player player) {
//         job.createPlayer(player, new CreatePlayerCallback() {
//             @Override
//             public void onCreatePlayerSuccess() {
//                 view.createPlayerComplete(player);
//             }
//         });
//     }
// 
//     public interface View {
//         void findPlayerComplete(Player player);
//         void createPlayerComplete(Player player);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/injector/EditPlayerComponent.java
// @PerActivity
// @Component(
//         dependencies = ApplicationComponent.class,
//         modules = {
//                 ActivityModule.class,
//                 EditPlayerDomainModule.class,
//                 EditPlayerDatasourceModule.class,
//                 SearchPlayerDataSourceModule.class,
//                 GlobalDomainModule.class
//         }
// )
// public interface EditPlayerComponent extends ActivityComponent {
//     void inject(EditPlayerFragment editPlayerFragment);
// }


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import javax.inject.Inject;
import butterknife.Bind;
import butterknife.OnClick;
import es.rogermartinez.paddlemanager.R;
import es.rogermartinez.paddlemanager.base.domain.events.ErrorEvent;
import es.rogermartinez.paddlemanager.base.domain.model.Player;
import es.rogermartinez.paddlemanager.base.view.fragment.BaseFragment;
import es.rogermartinez.paddlemanager.editplayer.view.controller.PrepareEditPlayerController;
import es.rogermartinez.paddlemanager.injector.EditPlayerComponent;
import fr.ganfra.materialspinner.MaterialSpinner;
package es.rogermartinez.paddlemanager.editplayer.view.fragment;




/**
 * Created by roger.martinez on 15/11/15.
 */
public class EditPlayerFragment extends BaseFragment implements PrepareEditPlayerController.View {

    @Inject
// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/domain/events/ErrorEvent.java
// public class ErrorEvent {
// 
//     public static final int ACTION_NO_ACTION = 0;
//     public static final int ACTION_REDIRECT_TO_LOGIN = 1;
//     public static final int ACTIONS_REQUEST_NEW_SCOPES = 2;
//     public static Exception exception;
// 
//     private String message;
//     private int action = ACTION_NO_ACTION;
// 
//     public ErrorEvent() {}
// 
//     public ErrorEvent(Exception exception) {
//         this.exception = exception;
//         this.message = exception.getMessage();
//     }
// 
//     public ErrorEvent(Exception exception, int action) {
//         this.exception = exception;
//         this.message = exception.getMessage();
//         this.action = action;
//     }
// 
//     public ErrorEvent(String message) {
//         this.message = message;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     public int getAction() { return action; }
// 
//     public void setAction(int action) { this.action = action; }
// 
//     public static Exception getException() {
//         return exception;
//     }
// 
//     public static void setException(Exception exception) {
//         ErrorEvent.exception = exception;
//     }
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/domain/model/Player.java
// public class Player implements Serializable {
//     private long id;
//     private String name = "";
//     private int level = 0;
//     private int sex = 0;
//     private int position = 0;
//     private String comment = "";
// 
//     public long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getLevel() {
//         return level;
//     }
// 
//     public void setLevel(int level) {
//         this.level = level;
//     }
// 
//     public int getSex() {
//         return sex;
//     }
// 
//     public void setSex(int sex) {
//         this.sex = sex;
//     }
// 
//     public int getPosition() {
//         return position;
//     }
// 
//     public void setPosition(int position) {
//         this.position = position;
//     }
// 
//     public String getComment() {
//         return comment;
//     }
// 
//     public void setComment(String comment) {
//         this.comment = comment;
//     }
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/base/view/fragment/BaseFragment.java
// public abstract class BaseFragment extends Fragment {
// 
//     @Override
//     public void onViewCreated(View view, Bundle savedInstanceState) {
//         super.onViewCreated(view, savedInstanceState);
//         ButterKnife.bind(this, view);
//     }
// 
//     public abstract boolean showError(ErrorEvent event);
// 
//     @Override
//     public void onResume() {
//         super.onResume();
//     }
// 
//     @SuppressWarnings("unchecked")
//     protected <C> C getComponent(Class<C> componentType) {
//         return componentType.cast(((HasComponent<C>) getActivity()).getComponent());
//     }
// 
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/editplayer/view/controller/PrepareEditPlayerController.java
// public class PrepareEditPlayerController {
// 
//     private CreatePlayer job;
//     private View view;
// 
//     public void setView(View view) {
//         this.view = view;
//     }
// 
//     @Inject
//     public PrepareEditPlayerController(CreatePlayer createPlayer){
//         this.job = createPlayer;
//     }
// 
//     public void getPlayer(){
//         view.findPlayerComplete(new Player());
//     }
// 
//     public void createPlayer(final Player player) {
//         job.createPlayer(player, new CreatePlayerCallback() {
//             @Override
//             public void onCreatePlayerSuccess() {
//                 view.createPlayerComplete(player);
//             }
//         });
//     }
// 
//     public interface View {
//         void findPlayerComplete(Player player);
//         void createPlayerComplete(Player player);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/es/rogermartinez/paddlemanager/injector/EditPlayerComponent.java
// @PerActivity
// @Component(
//         dependencies = ApplicationComponent.class,
//         modules = {
//                 ActivityModule.class,
//                 EditPlayerDomainModule.class,
//                 EditPlayerDatasourceModule.class,
//                 SearchPlayerDataSourceModule.class,
//                 GlobalDomainModule.class
//         }
// )
// public interface EditPlayerComponent extends ActivityComponent {
//     void inject(EditPlayerFragment editPlayerFragment);
// }


// Path: app/src/main/java/es/rogermartinez/paddlemanager/editplayer/view/fragment/EditPlayerFragment.java
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import javax.inject.Inject;
import butterknife.Bind;
import butterknife.OnClick;
import es.rogermartinez.paddlemanager.R;
import es.rogermartinez.paddlemanager.base.domain.events.ErrorEvent;
import es.rogermartinez.paddlemanager.base.domain.model.Player;
import es.rogermartinez.paddlemanager.base.view.fragment.BaseFragment;
import es.rogermartinez.paddlemanager.editplayer.view.controller.PrepareEditPlayerController;
import es.rogermartinez.paddlemanager.injector.EditPlayerComponent;
import fr.ganfra.materialspinner.MaterialSpinner;

package es.rogermartinez.paddlemanager.editplayer.view.fragment;




/**
 * Created by roger.martinez on 15/11/15.
 */
public class EditPlayerFragment extends BaseFragment implements PrepareEditPlayerController.View {

    @Inject
    PrepareEditPlayerController controller;