// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Lifecycle.java
// public interface Lifecycle extends Serializable {
// 
//     View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
// 
//     void onViewCreated(View view, NavigationManager navigationManager);
// 
//     void onResume(NavigationManager navigationManager);
// 
//     void onPause(NavigationManager navigationManager);
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Navigation.java
// public interface Navigation {
// 
//     String getNavTag();
// 
//     void setNavBundle(Bundle bundle);
//     Bundle getNavBundle();
// 
//     NavigationManager getNavigationManager();
// 
//     /**
//      * Begins a Transaction for presenting the next fragment allowing for overriding of animations, bundles, etc.
//      *
//      * @return
//      *      returns an instance of {@link PresentationTransaction} for the programmer to describe the next presentation
//      */
//     PresentationTransaction beginPresentation();
// 
//     /**
//      * Push a new Fragment onto the stack and presenting it to the screen
//      * Uses default animation of slide in from right and slide out to left.
//      *
//      * @param
//      *      navFragment -> The Fragment to show. It must be a Fragment that implements {@link Navigation}
//      */
//     void presentFragment(Navigation navFragment);
// 
//     /**
//      * Push a new Fragment onto the stack and presenting it to the screen
//      * Uses default animation of slide in from right and slide out to left.
//      * Sends a Bundle with the Fragment that can be retrieved using {@link Navigation#getNavBundle()}
//      *
//      * @param
//      *      navFragment -> The Fragment to show. It must be a Fragment that implements {@link Navigation}
//      * @param
//      *      navBundle -> Bundle to add to the presenting of the Fragment.
//      */
//     void presentFragment(Navigation navFragment, Bundle navBundle);
// 
//     /**
//      * Dimiss the current fragment off the top of the stack and dismiss it.
//      * Uses default animation of slide in from left and slide out to right animation.
//      */
//     void dismissFragment();
// 
//     /**
//      * Pop the current fragment off the top of the stack and dismiss it.
//      * Uses default animation of slide in from left and slide out to right animation.
//      *
//      * @param
//      *      navBundle -> The navigation bundle to add to the fragment after the pop occurs
//      */
//     void dismissFragment(Bundle navBundle);
// 
//     /**
//      * Dismiss all fragments to the given index in the stack
//      */
//     void dismissToIndex(int index);
// 
//     /**
//      * Dismiss all fragments from the stack until we reach the Root Fragment (the fragment at the min stack size)
//      */
//     void dismissToRoot();
// 
//     /**
//      * Remove all fragments from the stack including the Root. The add the given {@link Navigation}
//      * as the new root fragment. The definition of the Root Fragment is the Fragment at the min stack size position.
//      *
//      * @param
//      *      navFragment -> The fragment that you would like as the new Root of the stack.
//      */
//     void replaceRootFragment(Navigation navFragment);
// 
//     void setTitle(String title);
//     void setTitle(int resId);
//     String getTitle();
// 
//     boolean isPortrait();
//     boolean isTablet();
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/NavigationManagerContainer.java
// public interface NavigationManagerContainer {
// 
//     NavigationManager getNavigationManager();
// 
//     /**
//      * Get the current {@link FragmentManager} from the {@link NavigationManager}
//      *
//      * @return
//      *      Returns the Child Fragment Manager of the current fragment as an object to maintain a generic instance between
//      *      support and non support fragments
//      */
//     Object getNavChildFragmentManager();
// 
//     Activity getFragmentActivity();
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/NavigationManagerListener.java
// public interface NavigationManagerListener {
//     void didPresentFragment();
//     void didDismissFragment();
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Stack.java
// public interface Stack extends Serializable {
// 
//     Navigation pushFragment(NavigationManager navigationManager, Navigation navFragment, PresentationTransaction transaction);
// 
//     Navigation popFragment(NavigationManager navigationManager, Bundle navBundle);
// 
//     void clearNavigationStackToIndex(NavigationManager navigationManager, int index);
// 
//     void clearNavigationStackToIndex(NavigationManager navigationManager, int index, boolean inclusive);
// 
//     Navigation getFragmentAtIndex(NavigationManager navigationManager, int index);
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/State.java
// public interface State extends Serializable {
// 
//     Stack<String> getStack();
// 
//     void isTablet(boolean isTablet);
// 
//     boolean isTablet();
// 
//     void isPortrait(boolean isPortrait);
// 
//     boolean isPortrait();
// }


import android.os.Bundle;
import android.util.Log;
import com.github.dmcapps.navigationfragment.common.interfaces.Lifecycle;
import com.github.dmcapps.navigationfragment.common.interfaces.Navigation;
import com.github.dmcapps.navigationfragment.common.interfaces.NavigationManagerContainer;
import com.github.dmcapps.navigationfragment.common.interfaces.NavigationManagerListener;
import com.github.dmcapps.navigationfragment.common.interfaces.Stack;
import com.github.dmcapps.navigationfragment.common.interfaces.State;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
package com.github.dmcapps.navigationfragment.common.core;




/**
 * Created by dcarmo on 2016-12-18.
 */

public class NavigationManager implements Serializable {
    private static final String TAG = NavigationManager.class.getSimpleName();

    private transient NavigationManagerListener mListener;
    private transient WeakReference<NavigationManagerContainer> mContainer;

    // I don't like this ... but I'm having trouble thinking of a way to get rid of it ...
    private transient List<Navigation> mInitialNavigation;

    private NavigationConfig mNavigationConfig;

// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Lifecycle.java
// public interface Lifecycle extends Serializable {
// 
//     View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
// 
//     void onViewCreated(View view, NavigationManager navigationManager);
// 
//     void onResume(NavigationManager navigationManager);
// 
//     void onPause(NavigationManager navigationManager);
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Navigation.java
// public interface Navigation {
// 
//     String getNavTag();
// 
//     void setNavBundle(Bundle bundle);
//     Bundle getNavBundle();
// 
//     NavigationManager getNavigationManager();
// 
//     /**
//      * Begins a Transaction for presenting the next fragment allowing for overriding of animations, bundles, etc.
//      *
//      * @return
//      *      returns an instance of {@link PresentationTransaction} for the programmer to describe the next presentation
//      */
//     PresentationTransaction beginPresentation();
// 
//     /**
//      * Push a new Fragment onto the stack and presenting it to the screen
//      * Uses default animation of slide in from right and slide out to left.
//      *
//      * @param
//      *      navFragment -> The Fragment to show. It must be a Fragment that implements {@link Navigation}
//      */
//     void presentFragment(Navigation navFragment);
// 
//     /**
//      * Push a new Fragment onto the stack and presenting it to the screen
//      * Uses default animation of slide in from right and slide out to left.
//      * Sends a Bundle with the Fragment that can be retrieved using {@link Navigation#getNavBundle()}
//      *
//      * @param
//      *      navFragment -> The Fragment to show. It must be a Fragment that implements {@link Navigation}
//      * @param
//      *      navBundle -> Bundle to add to the presenting of the Fragment.
//      */
//     void presentFragment(Navigation navFragment, Bundle navBundle);
// 
//     /**
//      * Dimiss the current fragment off the top of the stack and dismiss it.
//      * Uses default animation of slide in from left and slide out to right animation.
//      */
//     void dismissFragment();
// 
//     /**
//      * Pop the current fragment off the top of the stack and dismiss it.
//      * Uses default animation of slide in from left and slide out to right animation.
//      *
//      * @param
//      *      navBundle -> The navigation bundle to add to the fragment after the pop occurs
//      */
//     void dismissFragment(Bundle navBundle);
// 
//     /**
//      * Dismiss all fragments to the given index in the stack
//      */
//     void dismissToIndex(int index);
// 
//     /**
//      * Dismiss all fragments from the stack until we reach the Root Fragment (the fragment at the min stack size)
//      */
//     void dismissToRoot();
// 
//     /**
//      * Remove all fragments from the stack including the Root. The add the given {@link Navigation}
//      * as the new root fragment. The definition of the Root Fragment is the Fragment at the min stack size position.
//      *
//      * @param
//      *      navFragment -> The fragment that you would like as the new Root of the stack.
//      */
//     void replaceRootFragment(Navigation navFragment);
// 
//     void setTitle(String title);
//     void setTitle(int resId);
//     String getTitle();
// 
//     boolean isPortrait();
//     boolean isTablet();
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/NavigationManagerContainer.java
// public interface NavigationManagerContainer {
// 
//     NavigationManager getNavigationManager();
// 
//     /**
//      * Get the current {@link FragmentManager} from the {@link NavigationManager}
//      *
//      * @return
//      *      Returns the Child Fragment Manager of the current fragment as an object to maintain a generic instance between
//      *      support and non support fragments
//      */
//     Object getNavChildFragmentManager();
// 
//     Activity getFragmentActivity();
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/NavigationManagerListener.java
// public interface NavigationManagerListener {
//     void didPresentFragment();
//     void didDismissFragment();
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/Stack.java
// public interface Stack extends Serializable {
// 
//     Navigation pushFragment(NavigationManager navigationManager, Navigation navFragment, PresentationTransaction transaction);
// 
//     Navigation popFragment(NavigationManager navigationManager, Bundle navBundle);
// 
//     void clearNavigationStackToIndex(NavigationManager navigationManager, int index);
// 
//     void clearNavigationStackToIndex(NavigationManager navigationManager, int index, boolean inclusive);
// 
//     Navigation getFragmentAtIndex(NavigationManager navigationManager, int index);
// 
// }
// 
// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/interfaces/State.java
// public interface State extends Serializable {
// 
//     Stack<String> getStack();
// 
//     void isTablet(boolean isTablet);
// 
//     boolean isTablet();
// 
//     void isPortrait(boolean isPortrait);
// 
//     boolean isPortrait();
// }


// Path: navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/common/core/NavigationManager.java
import android.os.Bundle;
import android.util.Log;
import com.github.dmcapps.navigationfragment.common.interfaces.Lifecycle;
import com.github.dmcapps.navigationfragment.common.interfaces.Navigation;
import com.github.dmcapps.navigationfragment.common.interfaces.NavigationManagerContainer;
import com.github.dmcapps.navigationfragment.common.interfaces.NavigationManagerListener;
import com.github.dmcapps.navigationfragment.common.interfaces.Stack;
import com.github.dmcapps.navigationfragment.common.interfaces.State;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;

package com.github.dmcapps.navigationfragment.common.core;




/**
 * Created by dcarmo on 2016-12-18.
 */

public class NavigationManager implements Serializable {
    private static final String TAG = NavigationManager.class.getSimpleName();

    private transient NavigationManagerListener mListener;
    private transient WeakReference<NavigationManagerContainer> mContainer;

    // I don't like this ... but I'm having trouble thinking of a way to get rid of it ...
    private transient List<Navigation> mInitialNavigation;

    private NavigationConfig mNavigationConfig;

    private Lifecycle mLifecycle;