-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new func for returns the given fragmentStackIndex #39
base: develop
Are you sure you want to change the base?
Add new func for returns the given fragmentStackIndex #39
Conversation
@@ -158,6 +158,19 @@ open class MultipleStackNavigator( | |||
initializeStackState() | |||
} | |||
|
|||
override fun reset(tabIndex: Int, fragmentStackIndex: Int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about targetStackIndex rather than fragmentStackIndex?
@@ -154,6 +154,13 @@ interface Navigator { | |||
*/ | |||
fun initialize(savedState: Bundle?) | |||
|
|||
/** | |||
* Returns the given fragmentStackIndex in the given tabIndex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please update the javadoc? I believe this was a copy paste mistake.
} | ||
fragmentManagerController.commitAllowingStateLoss() | ||
fragmentManagerController.enableFragment(getCurrentFragmentTag()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should handle else case too. We can call reset(tabIndex: Int, resetRootFragment: Boolean = true) to reset the tab or throw an exception. Which one do you think would be appropriate for your usecase?
Types of changes
Description
Added new function for returns the given fragmentStackIndex
Motivation and Context
In the step-by-step flows, user can want to return to one of the previous steps. With new function, we can return to the stack index in the tab we want.
How Has This Been Tested?
Added button to MainActivity for testing.
Screenshots (if appropriate):
Checklist: