Skip to content

Instantly share code, notes, and snippets.

@WilderMinds
Last active April 26, 2021 11:32
/**
* Stack to keep track of the number of navigation transactions
*/
private var navigationStack = Stack<ViewNavigation>()
/**
* Method to emulate navigation
* @param viewNavigation a view navigation object that contains the current view
* and the view you intend to navigate to.
*/
private fun navigate(viewNavigation: ViewNavigation) {
// You can apply any view transitions or animations here
viewNavigation.from.visibility = View.GONE // outgoing view
viewNavigation.to.visibility = View.VISIBLE // incoming view
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment