1 00:00:00,450 --> 00:00:01,770 In the next few sections, 2 00:00:01,770 --> 00:00:06,140 we'll look at how to track the way your users view products and buy things. 3 00:00:06,140 --> 00:00:08,770 This course does not teach how to 4 00:00:08,770 --> 00:00:11,280 implement the shopping cart functionality. 5 00:00:11,280 --> 00:00:16,160 What it does teach is how to add Analytics code to report data 6 00:00:16,160 --> 00:00:19,620 about the different steps in the shopping process. 7 00:00:19,620 --> 00:00:22,980 However, our dinner app needs a bit more functionality 8 00:00:22,980 --> 00:00:25,220 to be useful as a learning tool, in this case. 9 00:00:26,400 --> 00:00:31,440 You'll add an activity to the app to display all the dinners. 10 00:00:31,440 --> 00:00:34,340 This list will let your users see all the dinner choices and 11 00:00:34,340 --> 00:00:35,790 pick which ones they want to view. 12 00:00:37,530 --> 00:00:41,590 The dinner class already has a method, getAllDinners, 13 00:00:41,590 --> 00:00:43,900 that returns a list of all the dinners. 14 00:00:45,240 --> 00:00:47,030 So now we need to add an activity. 15 00:00:47,030 --> 00:00:49,140 To display all the dinners as a scrolling list. 16 00:00:50,280 --> 00:00:53,370 We also need to add a button on the home screen 17 00:00:53,370 --> 00:00:56,950 that starts the activity to display all the dinners. 18 00:00:58,110 --> 00:01:01,010 So you're going to need to add some code to your app. 19 00:01:01,010 --> 00:01:05,420 To start with, you're going to need to add the ShowAllDinnersActivity class. 20 00:01:05,420 --> 00:01:10,650 And then you'll need to add the method showDinnerList in the Main Activity. 21 00:01:10,650 --> 00:01:13,690 And the onClick action of the items in the list 22 00:01:13,690 --> 00:01:15,610 will be to go to the Order Dinner screen. 23 00:01:16,610 --> 00:01:19,350 So, currently the Order Dinner screen just displays an info 24 00:01:19,350 --> 00:01:20,850 box about ordering the dinner. 25 00:01:21,850 --> 00:01:24,820 But as you work through the next few sections, you'll be adding buttons to 26 00:01:24,820 --> 00:01:27,470 this screen to simulate steps in the purchase process. 27 00:01:28,480 --> 00:01:33,657 So you'll need to add the Show all the Dinners button to activity_main.xml. 28 00:01:33,657 --> 00:01:38,056 And then you're going to need the layout files for the scrolling list of dinners. 29 00:01:38,056 --> 00:01:45,110 So you'll add list_all_dinners.xml for the scrolling list itself. 30 00:01:45,110 --> 00:01:48,750 Then show_dinner_in_row.xml for each row in the list. 31 00:01:48,750 --> 00:01:53,573 If you're up for the challenge, write the code yourself, or 32 00:01:53,573 --> 00:01:59,340 if you want, you can just get the predefined code from GitHub, up to you.