bluelinelabs / bluelinelabs/Conductor
Child controllers not restored properly when hosted by controller's root view
- Dominant language
- Java
- Stars
- 3.9k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Description
I ran into a scenario where I have my activity router hosting a controller, call it A. Controller A's root view, the one returned from `onCreateView`, is hosting other controllers. When a new controller is pushed into the activity's router and then popped, controller A's child router doesn't properly restore its backstack. For now I'm able to workaround it by forcing the instantiation of the child router in `onCreateView`:
```kotlin
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup
): View {
val view = inflater.inflate(R.layout.some_view, container, false)
getChildRouter(view)
return view
}
```
Doing this causes the backstack to be restored properly.
Contributor guide
Research direction
Start by tracing controller A's onCreateView, the activity router's push/pop flow, and getChildRouter(view) to compare child-router restoration with and without forced instantiation. Reproduce the scenario described and verify that the child router restores its backstack after the hosted controller is popped without requiring getChildRouter(view) in onCreateView.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100