// Path: lifecyclebinder-lib/src/main/java/it/codingjam/lifecyclebinder/LifeCycleBinder.java
// public class LifeCycleBinder {
//     public static void bind(Fragment fragment) {
//         bind(fragment, fragment.getChildFragmentManager());
//     }
// 
//     public static void bind(FragmentActivity activity) {
//         bind(activity, activity.getSupportFragmentManager());
//     }
// 
//     public static <T extends Fragment> void bind(T fragment, Class<?> objectBinderClass) {
//         bind(fragment.getChildFragmentManager(), objectBinderClass);
//     }
// 
//     public static <T extends FragmentActivity> void bind(T activity, Class<?> objectBinderClass) {
//         bind(activity.getSupportFragmentManager(), objectBinderClass);
//     }
// 
//     private static <T> void bind(T obj, FragmentManager fragmentManager) {
//         LifeCycleBinderFragment<T> fragment = LifeCycleBinderFragment.get(fragmentManager);
//         if (fragment == null) {
//             Class<?> c = ReflectionUtils.getObjectBinderClass(obj);
//             fragment = LifeCycleBinderFragment.createAndAdd(fragmentManager, c);
//         }
//         fragment.invokeOnCreate();
//     }
// 
//     private static <T> void bind(FragmentManager fragmentManager, Class<?> objectBinderClass) {
//         LifeCycleBinderFragment<T> fragment = LifeCycleBinderFragment.get(fragmentManager);
//         if (fragment == null) {
//             fragment = LifeCycleBinderFragment.createAndAdd(fragmentManager, objectBinderClass);
//         }
//         fragment.invokeOnCreate();
//     }
// 
//     public static void startActivityForResult(FragmentActivity activity, Intent intent, int requestCode) {
//         LifeCycleBinderFragment.get(activity.getSupportFragmentManager()).startActivityForResult(intent, requestCode);
//     }
// 
//     public static void startActivityForResult(Fragment fragment, Intent intent, int requestCode) {
//         LifeCycleBinderFragment.get(fragment.getChildFragmentManager()).startActivityForResult(intent, requestCode);
//     }
// }


import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import it.codingjam.lifecyclebinder.BindEvent;
import it.codingjam.lifecyclebinder.LifeCycleBinder;
import it.codingjam.lifecyclebinder.mvp.R;
import static it.codingjam.lifecyclebinder.LifeCycleEvent.CREATE;
package it.codingjam.lifecyclebinder.mvvm;



public class Navigator {

    private FragmentActivity activity;

    @BindEvent(CREATE) public void onCreate(FragmentActivity activity) {
        this.activity = activity;
    }

    public void share(String message, int requestCode) {
        Intent sendIntent = new Intent();
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, message);
        sendIntent.setType("text/plain");
        Intent chooser = Intent.createChooser(sendIntent, activity.getResources().getText(R.string.share));
// Path: lifecyclebinder-lib/src/main/java/it/codingjam/lifecyclebinder/LifeCycleBinder.java
// public class LifeCycleBinder {
//     public static void bind(Fragment fragment) {
//         bind(fragment, fragment.getChildFragmentManager());
//     }
// 
//     public static void bind(FragmentActivity activity) {
//         bind(activity, activity.getSupportFragmentManager());
//     }
// 
//     public static <T extends Fragment> void bind(T fragment, Class<?> objectBinderClass) {
//         bind(fragment.getChildFragmentManager(), objectBinderClass);
//     }
// 
//     public static <T extends FragmentActivity> void bind(T activity, Class<?> objectBinderClass) {
//         bind(activity.getSupportFragmentManager(), objectBinderClass);
//     }
// 
//     private static <T> void bind(T obj, FragmentManager fragmentManager) {
//         LifeCycleBinderFragment<T> fragment = LifeCycleBinderFragment.get(fragmentManager);
//         if (fragment == null) {
//             Class<?> c = ReflectionUtils.getObjectBinderClass(obj);
//             fragment = LifeCycleBinderFragment.createAndAdd(fragmentManager, c);
//         }
//         fragment.invokeOnCreate();
//     }
// 
//     private static <T> void bind(FragmentManager fragmentManager, Class<?> objectBinderClass) {
//         LifeCycleBinderFragment<T> fragment = LifeCycleBinderFragment.get(fragmentManager);
//         if (fragment == null) {
//             fragment = LifeCycleBinderFragment.createAndAdd(fragmentManager, objectBinderClass);
//         }
//         fragment.invokeOnCreate();
//     }
// 
//     public static void startActivityForResult(FragmentActivity activity, Intent intent, int requestCode) {
//         LifeCycleBinderFragment.get(activity.getSupportFragmentManager()).startActivityForResult(intent, requestCode);
//     }
// 
//     public static void startActivityForResult(Fragment fragment, Intent intent, int requestCode) {
//         LifeCycleBinderFragment.get(fragment.getChildFragmentManager()).startActivityForResult(intent, requestCode);
//     }
// }


// Path: lifecyclebinder-demo-mvvm/src/main/java/it/codingjam/lifecyclebinder/mvvm/Navigator.java
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
import it.codingjam.lifecyclebinder.BindEvent;
import it.codingjam.lifecyclebinder.LifeCycleBinder;
import it.codingjam.lifecyclebinder.mvp.R;
import static it.codingjam.lifecyclebinder.LifeCycleEvent.CREATE;

package it.codingjam.lifecyclebinder.mvvm;



public class Navigator {

    private FragmentActivity activity;

    @BindEvent(CREATE) public void onCreate(FragmentActivity activity) {
        this.activity = activity;
    }

    public void share(String message, int requestCode) {
        Intent sendIntent = new Intent();
        sendIntent.setAction(Intent.ACTION_SEND);
        sendIntent.putExtra(Intent.EXTRA_TEXT, message);
        sendIntent.setType("text/plain");
        Intent chooser = Intent.createChooser(sendIntent, activity.getResources().getText(R.string.share));
        LifeCycleBinder.startActivityForResult(activity, chooser, requestCode);