This course will be retired on July 14, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- What is Model-View-Presenter (MVP)? 4:45
- Why Do We Use MVP? 3:28
- Review: Model-View-Presenter 8 questions
- Defining the Data Model 2:53
- Implementing the Data Model 6:26
- Creating a Data Model 4 objectives
- Adding Story Resources 2:57
- Creating the Story 3:54
- Adding Custom Constructors 4:05
- Adding a Custom Constructor 2 objectives

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Finally, we will make our model code even easier to work with by adding some custom constructors to our Page and Choice classes.
GitHub Repo
Code for copy/paste:
pages[1] = new Page(R.drawable.page1,
R.string.page1,
new Choice(R.string.page1_choice1, 3),
new Choice(R.string.page1_choice2, 4));
pages[2] = new Page(R.drawable.page2,
R.string.page2,
new Choice(R.string.page2_choice1, 4),
new Choice(R.string.page2_choice2, 6));
pages[3] = new Page(R.drawable.page3,
R.string.page3,
new Choice(R.string.page3_choice1, 4),
new Choice(R.string.page3_choice2, 5));
pages[4] = new Page(R.drawable.page4,
R.string.page4,
new Choice(R.string.page4_choice1, 5),
new Choice(R.string.page4_choice2, 6));
pages[5] = new Page(R.drawable.page5, R.string.page5);
pages[6] = new Page(R.drawable.page6, R.string.page6);
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
elisha day
5,115 Points0 Answers
-
Yusuf Mohamed
2,631 Points1 Answer
-
Santiago Serrano
2,754 Points1 Answer
-
PLUS
Alok Singh
Courses Plus Student 3,397 Points2 Answers
-
suchita rawat
1,710 Points2 Answers
-
Jose Nunez
923 PointsUnderstanding how we constructed the pages in the Constructor
Posted by Jose NunezJose Nunez
923 Points3 Answers
-
Will Sokolowski
2,292 Points3 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up