android / android/architecture-samples

[todo-mvp] Pager Sample

Open
#207 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

How would you go about creating a View-Presenter pair using FragmentPagerAdapter? In the case of a TODO App, what if I wanted to create a screen with 3 Tabs - Active, Completed, and... errr... Something.

I tried creating a View-Presenter pair for the page Fragments, but presenter.start() crashes on rotate because presenter is null. The page Fragment's onResume() is called before the presenter was initialized in the PagerAdapter constructor.

I'm guessing that instead of creating the View-Presenter pairs for the page Fragments (which are sub-views), it should only be done for the Activity content Fragment (the "main" view). I might be wrong though, so I need guidance.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the TODO-MVP Activity, its FragmentPagerAdapter, and the page Fragment lifecycle described in the issue. Determine whether the sample should use View-Presenter pairs for pager pages or only for the main content Fragment; done requires an agreed design and a working three-tab sample that survives rotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.