// Path: drodrolib/src/main/java/org/michenux/drodrolib/MCXApplication.java
// public class MCXApplication extends MultiDexApplication {
//     public static final String LOG_TAG = "MCX";
// 
//     private ObjectGraph objectGraph;
// 
//     public void inject(Activity activity) {
//         getObjectGraph().inject(activity);
//     }
// 
//     public void inject(ContentProvider contentProvider) {
//         getObjectGraph().inject(contentProvider);
//     }
// 
//     public void inject(Fragment fragment) {
//         getObjectGraph().inject(fragment);
//     }
// 
//     public void inject(AbstractThreadedSyncAdapter fragment) {
//         getObjectGraph().inject(fragment);
//     }
// 
//     public void injectSelf() {
//         getObjectGraph().inject(this);
//     }
// 
//     public synchronized ObjectGraph getObjectGraph() {
//         if (objectGraph == null) {
//             List<Object> modules = new ArrayList<>();
//             buildDaggerModules(modules);
//             this.objectGraph = ObjectGraph.create(modules.toArray());
//             onObjectGraphCreated(this.objectGraph);
//         }
//         return objectGraph;
//     }
// 
//     public void buildDaggerModules(List<Object> modules) {
//         modules.add(new MCXModule());
//     }
// 
//     public void onObjectGraphCreated(ObjectGraph objectGraph) {
//     }
// 
//     public static MCXApplication getRealApplication(Context applicationContext) {
//         MCXApplication application = null;
// 
//         if (applicationContext instanceof MCXApplication) {
//             application = (MCXApplication) applicationContext;
//         } else {
//             Application realApplication = null;
//             Field magicField = null;
//             try {
//                 magicField = applicationContext.getClass().getDeclaredField("realApplication");
//                 magicField.setAccessible(true);
//                 realApplication = (Application) magicField.get(applicationContext);
//             } catch (NoSuchFieldException e) {
//                 Log.e(LOG_TAG, e.getMessage(), e);
//             } catch (IllegalAccessException e) {
//                 Log.e(LOG_TAG, e.getMessage(), e);
//             }
// 
//             application = (MCXApplication) realApplication;
//         }
// 
//         return application;
//     }
// }
// 
// Path: drodrolib/src/main/java/org/michenux/drodrolib/security/UserHelper.java
// @Singleton
// public class UserHelper {
//     private User mCurrentUser;
// 
//     @Inject
//     public UserHelper() {
//     }
// 
//     public User getCurrentUser() {
//         return mCurrentUser;
//     }
// 
//     public void setCurrentUser(User currentUser) {
//         this.mCurrentUser = currentUser;
//     }
// }


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.common.SignInButton;
import org.michenux.drodrolib.MCXApplication;
import org.michenux.drodrolib.R;
import org.michenux.drodrolib.security.UserHelper;
import org.michenux.drodrolib.security.UserSessionCallback;
import javax.inject.Inject;
        View view = inflater.inflate(R.layout.login_googleplus, container, false);
        mSignInButton = (SignInButton) view.findViewById(R.id.sign_in_button);
        mSignInButton.setOnClickListener(this);
        return view;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        mGoogleAuthDelegate.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onStart() {
        super.onStart();
        mGoogleAuthDelegate.onStart();
    }

    @Override
    public void onLogin() {
        updateButtons(true);
        this.getActivity().finish();
    }

    @Override
    public void onLogout() {
        updateButtons(false);
    }

    private void updateButtons(boolean isSignedIn) {
// Path: drodrolib/src/main/java/org/michenux/drodrolib/MCXApplication.java
// public class MCXApplication extends MultiDexApplication {
//     public static final String LOG_TAG = "MCX";
// 
//     private ObjectGraph objectGraph;
// 
//     public void inject(Activity activity) {
//         getObjectGraph().inject(activity);
//     }
// 
//     public void inject(ContentProvider contentProvider) {
//         getObjectGraph().inject(contentProvider);
//     }
// 
//     public void inject(Fragment fragment) {
//         getObjectGraph().inject(fragment);
//     }
// 
//     public void inject(AbstractThreadedSyncAdapter fragment) {
//         getObjectGraph().inject(fragment);
//     }
// 
//     public void injectSelf() {
//         getObjectGraph().inject(this);
//     }
// 
//     public synchronized ObjectGraph getObjectGraph() {
//         if (objectGraph == null) {
//             List<Object> modules = new ArrayList<>();
//             buildDaggerModules(modules);
//             this.objectGraph = ObjectGraph.create(modules.toArray());
//             onObjectGraphCreated(this.objectGraph);
//         }
//         return objectGraph;
//     }
// 
//     public void buildDaggerModules(List<Object> modules) {
//         modules.add(new MCXModule());
//     }
// 
//     public void onObjectGraphCreated(ObjectGraph objectGraph) {
//     }
// 
//     public static MCXApplication getRealApplication(Context applicationContext) {
//         MCXApplication application = null;
// 
//         if (applicationContext instanceof MCXApplication) {
//             application = (MCXApplication) applicationContext;
//         } else {
//             Application realApplication = null;
//             Field magicField = null;
//             try {
//                 magicField = applicationContext.getClass().getDeclaredField("realApplication");
//                 magicField.setAccessible(true);
//                 realApplication = (Application) magicField.get(applicationContext);
//             } catch (NoSuchFieldException e) {
//                 Log.e(LOG_TAG, e.getMessage(), e);
//             } catch (IllegalAccessException e) {
//                 Log.e(LOG_TAG, e.getMessage(), e);
//             }
// 
//             application = (MCXApplication) realApplication;
//         }
// 
//         return application;
//     }
// }
// 
// Path: drodrolib/src/main/java/org/michenux/drodrolib/security/UserHelper.java
// @Singleton
// public class UserHelper {
//     private User mCurrentUser;
// 
//     @Inject
//     public UserHelper() {
//     }
// 
//     public User getCurrentUser() {
//         return mCurrentUser;
//     }
// 
//     public void setCurrentUser(User currentUser) {
//         this.mCurrentUser = currentUser;
//     }
// }


// Path: drodrolib/src/main/java/org/michenux/drodrolib/gms/auth/GoogleAuthFragment.java
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.gms.common.SignInButton;
import org.michenux.drodrolib.MCXApplication;
import org.michenux.drodrolib.R;
import org.michenux.drodrolib.security.UserHelper;
import org.michenux.drodrolib.security.UserSessionCallback;
import javax.inject.Inject;

        View view = inflater.inflate(R.layout.login_googleplus, container, false);
        mSignInButton = (SignInButton) view.findViewById(R.id.sign_in_button);
        mSignInButton.setOnClickListener(this);
        return view;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        mGoogleAuthDelegate.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onStart() {
        super.onStart();
        mGoogleAuthDelegate.onStart();
    }

    @Override
    public void onLogin() {
        updateButtons(true);
        this.getActivity().finish();
    }

    @Override
    public void onLogout() {
        updateButtons(false);
    }

    private void updateButtons(boolean isSignedIn) {
        if (isSignedIn) {