bluelinelabs / bluelinelabs/Conductor

Recommended way to update content inside childcontrollers with viewpager/RouterPagerAdapter

Open
#414 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.9k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm struggling/fail to see how I could update content in the childcontrollers managed through a RouterPagerAdapter/viewpager/Tablayout setup after they have been created (and what would be best practice) .

The questions I have:
- Is it the purpose to get a reference to the controller instance and try to call and update function or should it be done through an eventbus/pub-sub type of setup.

- How can I get a reference to the Controller that is currently active in the viewpager. There's no such thing as getItem() as its based on pageradapter

- There seem to exists methods to get a controller but you need an Id. Should I get it on creation and store it somewhere in order to try to use it later?

- Should I use any update logic inside the children. use viewpager.setoffscreenpagelimit in order to force the full lifecycle all the time.

thanks for your thoughts.

Contributor guide

Open the contributing guide

Research direction

Start with the RouterPagerAdapter and its ViewPager/TabLayout integration, then review how child controllers are created and retained. Done means documenting a recommended way to update child-controller content, obtain the active controller, and handle lifecycle updates without relying on an unspecified offscreen-page limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.