// Path: app/src/main/java/fr/guddy/android_modular_reloaded/MainActivity.java
// public class MainActivity
//         extends AppCompatActivity
//         implements HasSupportFragmentInjector {
// 
//     //region Injected fields
//     @Inject
//     public DispatchingAndroidInjector<Fragment> supportFragmentInjector;
//     //endregion
// 
//     //region Fields
//     private SharedViewModel mSharedViewModel;
//     private EasyFlow<FlowContext> mFlow;
//     //endregion
// 
//     //region Lifecycle
//     @Override
//     protected void onCreate(final Bundle pSavedInstanceState) {
//         AndroidInjection.inject(this);
//         super.onCreate(pSavedInstanceState);
//         setContentView(R.layout.activity_main);
//         mSharedViewModel = ViewModelProviders.of(this).get(SharedViewModel.class);
// 
//         mFlow =
//                 from(FragmentFirst.States.WAITING_LOGIN).transit(
//                         on(FragmentFirst.Events.loginProvided).to(FragmentSecond.States.SHOWING_WELCOME).transit(
//                                 on(Events.backPressed).to(FragmentFirst.States.WAITING_LOGIN)
//                         )
//                 );
// 
//         mFlow.executor(new UiThreadExecutor());
// 
//         mFlow.whenEnter(FragmentFirst.States.WAITING_LOGIN, (@NonNull final FlowContext pContext) -> {
//             final FragmentManager lFragmentManager = getSupportFragmentManager();
//             if (lFragmentManager.findFragmentById(R.id.ActivityMain_ViewGroup_Container) == null) {
//                 lFragmentManager.beginTransaction()
//                         .replace(R.id.ActivityMain_ViewGroup_Container, FragmentFirst.newInstance())
//                         .commit();
//             }
//         });
// 
//         mFlow.whenEnter(FragmentSecond.States.SHOWING_WELCOME, (@NonNull final FlowContext pContext) -> {
//             final String lLogin = new FragmentFirstOutput(pContext.args()).login;
//             getSupportFragmentManager().beginTransaction()
//                     .replace(R.id.ActivityMain_ViewGroup_Container, FragmentSecond.newInstance(lLogin))
//                     .addToBackStack(null)
//                     .commit();
//         });
// 
//         mFlow.whenLeave(FragmentSecond.States.SHOWING_WELCOME, (@NonNull final FlowContext pContext) -> pContext.args().clear());
// 
//         mSharedViewModel.getFlowContextLiveData()
//                 .observe(
//                         this,
//                         (@NonNull final SharedViewModel.LiveDataFlowContext pLiveDataFlowContext) ->
//                                 mFlow.start(pLiveDataFlowContext.forceEnterInitialState, pLiveDataFlowContext.flowContext)
//                 );
//     }
//     //endregion
// 
//     //region Overridden methods
//     @Override
//     public void onBackPressed() {
//         final FragmentManager lFragmentManager = getSupportFragmentManager();
//         if (lFragmentManager.getBackStackEntryCount() > 0) {
//             mSharedViewModel.safeTrigger(Events.backPressed);
//             lFragmentManager.popBackStack();
//         } else {
//             super.onBackPressed();
//         }
//     }
//     //endregion
// 
//     //region HasSupportFragmentInjector
//     @Override
//     public AndroidInjector<Fragment> supportFragmentInjector() {
//         return supportFragmentInjector;
//     }
//     //endregion
// 
//     //region FSM
//     private enum Events implements EventEnum {
//         backPressed
//     }
//     //endregion
// }


import android.app.Activity;
import dagger.Binds;
import dagger.Module;
import dagger.android.ActivityKey;
import dagger.android.AndroidInjector;
import dagger.multibindings.IntoMap;
import fr.guddy.android_modular_reloaded.MainActivity;
package fr.guddy.android_modular_reloaded.di;



@Module(subcomponents = {
        ComponentMainActivity.class
})
public abstract class ActivityBindingModule {
    @Binds
    @IntoMap
// Path: app/src/main/java/fr/guddy/android_modular_reloaded/MainActivity.java
// public class MainActivity
//         extends AppCompatActivity
//         implements HasSupportFragmentInjector {
// 
//     //region Injected fields
//     @Inject
//     public DispatchingAndroidInjector<Fragment> supportFragmentInjector;
//     //endregion
// 
//     //region Fields
//     private SharedViewModel mSharedViewModel;
//     private EasyFlow<FlowContext> mFlow;
//     //endregion
// 
//     //region Lifecycle
//     @Override
//     protected void onCreate(final Bundle pSavedInstanceState) {
//         AndroidInjection.inject(this);
//         super.onCreate(pSavedInstanceState);
//         setContentView(R.layout.activity_main);
//         mSharedViewModel = ViewModelProviders.of(this).get(SharedViewModel.class);
// 
//         mFlow =
//                 from(FragmentFirst.States.WAITING_LOGIN).transit(
//                         on(FragmentFirst.Events.loginProvided).to(FragmentSecond.States.SHOWING_WELCOME).transit(
//                                 on(Events.backPressed).to(FragmentFirst.States.WAITING_LOGIN)
//                         )
//                 );
// 
//         mFlow.executor(new UiThreadExecutor());
// 
//         mFlow.whenEnter(FragmentFirst.States.WAITING_LOGIN, (@NonNull final FlowContext pContext) -> {
//             final FragmentManager lFragmentManager = getSupportFragmentManager();
//             if (lFragmentManager.findFragmentById(R.id.ActivityMain_ViewGroup_Container) == null) {
//                 lFragmentManager.beginTransaction()
//                         .replace(R.id.ActivityMain_ViewGroup_Container, FragmentFirst.newInstance())
//                         .commit();
//             }
//         });
// 
//         mFlow.whenEnter(FragmentSecond.States.SHOWING_WELCOME, (@NonNull final FlowContext pContext) -> {
//             final String lLogin = new FragmentFirstOutput(pContext.args()).login;
//             getSupportFragmentManager().beginTransaction()
//                     .replace(R.id.ActivityMain_ViewGroup_Container, FragmentSecond.newInstance(lLogin))
//                     .addToBackStack(null)
//                     .commit();
//         });
// 
//         mFlow.whenLeave(FragmentSecond.States.SHOWING_WELCOME, (@NonNull final FlowContext pContext) -> pContext.args().clear());
// 
//         mSharedViewModel.getFlowContextLiveData()
//                 .observe(
//                         this,
//                         (@NonNull final SharedViewModel.LiveDataFlowContext pLiveDataFlowContext) ->
//                                 mFlow.start(pLiveDataFlowContext.forceEnterInitialState, pLiveDataFlowContext.flowContext)
//                 );
//     }
//     //endregion
// 
//     //region Overridden methods
//     @Override
//     public void onBackPressed() {
//         final FragmentManager lFragmentManager = getSupportFragmentManager();
//         if (lFragmentManager.getBackStackEntryCount() > 0) {
//             mSharedViewModel.safeTrigger(Events.backPressed);
//             lFragmentManager.popBackStack();
//         } else {
//             super.onBackPressed();
//         }
//     }
//     //endregion
// 
//     //region HasSupportFragmentInjector
//     @Override
//     public AndroidInjector<Fragment> supportFragmentInjector() {
//         return supportFragmentInjector;
//     }
//     //endregion
// 
//     //region FSM
//     private enum Events implements EventEnum {
//         backPressed
//     }
//     //endregion
// }


// Path: app/src/main/java/fr/guddy/android_modular_reloaded/di/ActivityBindingModule.java
import android.app.Activity;
import dagger.Binds;
import dagger.Module;
import dagger.android.ActivityKey;
import dagger.android.AndroidInjector;
import dagger.multibindings.IntoMap;
import fr.guddy.android_modular_reloaded.MainActivity;

package fr.guddy.android_modular_reloaded.di;



@Module(subcomponents = {
        ComponentMainActivity.class
})
public abstract class ActivityBindingModule {
    @Binds
    @IntoMap
    @ActivityKey(MainActivity.class)