Interface NavigationListener
-
public interface NavigationListenerAn external observer of navigation events.Registered through
Navigator.addNavigationListener(NavigationListener). The callback is delivered at the same time as the corresponding page lifecycle callbacks, once per navigation operation (Navigator.navigateTo(int),Navigator.navigateBack(),Navigator.navigateBackTo(int),Navigator.replaceWith(int)). A navigation requested fromonNavigation(ej.navigation.Page, ej.navigation.Page)is deferred and performed once the navigation in progress is finished.onNavigation(ej.navigation.Page, ej.navigation.Page)receives thePageinstances so the "no page exited on the first navigation" case stays expressible as anull; an application that needs keys can callNavigator.getActiveKey().- Since:
- 0.2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonNavigation(Page exitedPage, Page enteredPage)Notifies that the active page has changed fromexitedPagetoenteredPage.
-
-
-
Method Detail
-
onNavigation
void onNavigation(@Nullable Page exitedPage, Page enteredPage)Notifies that the active page has changed fromexitedPagetoenteredPage.Fires once per navigation. On the first navigation no page is exited, so
exitedPageisnull; on every navigation thereafter it is the page that was active before.- Parameters:
exitedPage- the page that was active before, ornullwhen the entered page is the first page ever shown.enteredPage- the page that is now active.
-
-