// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IContextMenuManager.java
// public interface IContextMenuManager {
// 
//     /**
//      * @param view       - which shows context menu
//      * @param type       - type of context menu to show
//      * @param dataToPass - data which will be used for actions inside menu
//      */
//     void openContextMenu(View view, ContextMenuType type, Object dataToPass, IOperationFinishCallback contextItemClicked);
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IControlStackHistory.java
// public interface IControlStackHistory {
//     boolean shouldBeAddedToStack();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IFragmentsManager.java
// public interface IFragmentsManager {
// 
//     enum FragmentOpenType {REPLACE, OVERLAY}
// 
//     enum FragmentAnimationType {DEFAULT, BOTTOM_TOP}
// 
// 
//     void showFragment(int id, Fragment fragment, String tag, FragmentOpenType openType, FragmentAnimationType animationType);
// 
//     void showFragment(int id, Fragment fragment, String tag);
// 
//     void hideFragment(Fragment fragment);
// 
//     void showDialogFragment(DialogFragment dialogFragment);
// 
//     boolean hasFragment(String tag);
// 
//     String getLatestFragmentTag();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IOperationFinishCallback.java
// public interface IOperationFinishCallback {
// 
//     void operationFinished();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IOverlayable.java
// public interface IOverlayable {
//     void toggleOverlay();
//     boolean isOverlayShown();
//     void setOverlayAlpha(int alphaPercent);
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/utils/enums/ContextMenuType.java
// public enum ContextMenuType {
// 
//     CARD_DEFAULT, EPISODE_MIDDLE_SCREEN, PODCAST_MIDDLE_SCREEN, PLAYER_SETTINGS, PROFILE
// }


import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.chickenkiller.upods2.R;
import com.chickenkiller.upods2.interfaces.IContextMenuManager;
import com.chickenkiller.upods2.interfaces.IControlStackHistory;
import com.chickenkiller.upods2.interfaces.IFragmentsManager;
import com.chickenkiller.upods2.interfaces.IOperationFinishCallback;
import com.chickenkiller.upods2.interfaces.IOverlayable;
import com.chickenkiller.upods2.utils.enums.ContextMenuType;
import java.util.Calendar;
        android.app.FragmentManager fm = getFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        if (animationType == IFragmentsManager.FragmentAnimationType.BOTTOM_TOP) {
            ft.setCustomAnimations(R.animator.animation_fragment_bototm_top, R.animator.animation_fragment_top_bototm,
                    R.animator.animation_fragment_bototm_top, R.animator.animation_fragment_top_bototm);
        }
        if (openType == IFragmentsManager.FragmentOpenType.OVERLAY) {
            ft.add(id, fragment, tag);
            if (this instanceof IOverlayable) {
                ((IOverlayable) this).toggleOverlay();
            }
        } else {
            ft.replace(id, fragment, tag);
        }
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);

        if (fragment instanceof IControlStackHistory) {//Decide ether fragment should be added to stack history
            if (((IControlStackHistory) fragment).shouldBeAddedToStack()) {
                ft.addToBackStack(tag);
            }
        } else {
            ft.addToBackStack(tag);
        }

        ft.commitAllowingStateLoss();
    }


    @Override
    public void showFragment(int id, Fragment fragment, String tag) {
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IContextMenuManager.java
// public interface IContextMenuManager {
// 
//     /**
//      * @param view       - which shows context menu
//      * @param type       - type of context menu to show
//      * @param dataToPass - data which will be used for actions inside menu
//      */
//     void openContextMenu(View view, ContextMenuType type, Object dataToPass, IOperationFinishCallback contextItemClicked);
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IControlStackHistory.java
// public interface IControlStackHistory {
//     boolean shouldBeAddedToStack();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IFragmentsManager.java
// public interface IFragmentsManager {
// 
//     enum FragmentOpenType {REPLACE, OVERLAY}
// 
//     enum FragmentAnimationType {DEFAULT, BOTTOM_TOP}
// 
// 
//     void showFragment(int id, Fragment fragment, String tag, FragmentOpenType openType, FragmentAnimationType animationType);
// 
//     void showFragment(int id, Fragment fragment, String tag);
// 
//     void hideFragment(Fragment fragment);
// 
//     void showDialogFragment(DialogFragment dialogFragment);
// 
//     boolean hasFragment(String tag);
// 
//     String getLatestFragmentTag();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IOperationFinishCallback.java
// public interface IOperationFinishCallback {
// 
//     void operationFinished();
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/interfaces/IOverlayable.java
// public interface IOverlayable {
//     void toggleOverlay();
//     boolean isOverlayShown();
//     void setOverlayAlpha(int alphaPercent);
// }
// 
// Path: app/src/main/java/com/chickenkiller/upods2/utils/enums/ContextMenuType.java
// public enum ContextMenuType {
// 
//     CARD_DEFAULT, EPISODE_MIDDLE_SCREEN, PODCAST_MIDDLE_SCREEN, PLAYER_SETTINGS, PROFILE
// }


// Path: app/src/main/java/com/chickenkiller/upods2/activity/BasicActivity.java
import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.chickenkiller.upods2.R;
import com.chickenkiller.upods2.interfaces.IContextMenuManager;
import com.chickenkiller.upods2.interfaces.IControlStackHistory;
import com.chickenkiller.upods2.interfaces.IFragmentsManager;
import com.chickenkiller.upods2.interfaces.IOperationFinishCallback;
import com.chickenkiller.upods2.interfaces.IOverlayable;
import com.chickenkiller.upods2.utils.enums.ContextMenuType;
import java.util.Calendar;

        android.app.FragmentManager fm = getFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        if (animationType == IFragmentsManager.FragmentAnimationType.BOTTOM_TOP) {
            ft.setCustomAnimations(R.animator.animation_fragment_bototm_top, R.animator.animation_fragment_top_bototm,
                    R.animator.animation_fragment_bototm_top, R.animator.animation_fragment_top_bototm);
        }
        if (openType == IFragmentsManager.FragmentOpenType.OVERLAY) {
            ft.add(id, fragment, tag);
            if (this instanceof IOverlayable) {
                ((IOverlayable) this).toggleOverlay();
            }
        } else {
            ft.replace(id, fragment, tag);
        }
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);

        if (fragment instanceof IControlStackHistory) {//Decide ether fragment should be added to stack history
            if (((IControlStackHistory) fragment).shouldBeAddedToStack()) {
                ft.addToBackStack(tag);
            }
        } else {
            ft.addToBackStack(tag);
        }

        ft.commitAllowingStateLoss();
    }


    @Override
    public void showFragment(int id, Fragment fragment, String tag) {
        showFragment(id, fragment, tag, IFragmentsManager.FragmentOpenType.REPLACE, IFragmentsManager.FragmentAnimationType.DEFAULT);