package com.xg.navigation.delegates.bottom;

import com.xg.navigation.delegates.NavigationDelegate;

/**
 * Created by yuanyuan on 18-1-18.
 */

public abstract class BottomItemDelegate extends NavigationDelegate {

    @Override
    public boolean onBackPressedSupport() {

        if (null == getParentDelegate()) {
                    return super.onBackPressedSupport();
        }

        if (getChildFragmentManager().getBackStackEntryCount() > 1) {
            getSupportDelegate().popChild();
            return true;
        }

        return getParentDelegate().onBackPressedSupport();
    }
}
