Closed DomiBlaze closed 6 years ago
You can extend FragmentScreenSwitcher
to delegate switching of inner fragments to additional screen switchers. Like that:
public interface ScreenSwitcherProvider {
ScreenSwitcher getScreenSwitcher();
}
public class MainScreenSwitcher extends FragmentScreenSwitcher {
// constructors are ommited
@Override
public void switchTo(Screen screen, @Nullable AnimationData animationData) throws NavigationException {
if (isInner(screen)) {
ScreenSwitcher screenSwitcher = ((ScreenSwitcherProvider) getCurrentFragment()).getScreenSwitcher();
screenSwitcher.switchTo(screen, animationData);
} else {
super.switchTo(screen, animationData);
}
}
}
Is it possible to implement nested
FragmentScreenSwitcher
? One of my fragments(let's call itHostFragment
) has a bottom navigation implemented, and I want to useswitchTo
to switch betweed child fragments ofHostFragment
. Furthermore, I haveAnotherHostFragment
with different set of fragments. I want to solve this problem without additional activities, in a single activity app setup.Thank you in advance