[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.06,0:00:04.26,Default,,0000,0000,0000,,Once again, here's the design\Nwe're looking to create. Dialogue: 0,0:00:04.26,0:00:08.53,Default,,0000,0000,0000,,What's great about this view is that\Nit uses mostly UI elements we've seen Dialogue: 0,0:00:08.53,0:00:09.06,Default,,0000,0000,0000,,before. Dialogue: 0,0:00:09.06,0:00:11.57,Default,,0000,0000,0000,,In order to prevent the number\Nof complex layouts from growing Dialogue: 0,0:00:11.57,0:00:14.30,Default,,0000,0000,0000,,explosively, we're going to\Ntake advantage of three Android Dialogue: 0,0:00:14.30,0:00:15.52,Default,,0000,0000,0000,,layout features. Dialogue: 0,0:00:15.52,0:00:17.24,Default,,0000,0000,0000,,The first one we've seen before. Dialogue: 0,0:00:17.24,0:00:20.47,Default,,0000,0000,0000,,The only difference between\Na forecast list item on the phone and Dialogue: 0,0:00:20.47,0:00:23.39,Default,,0000,0000,0000,,on the tablet is padding and\Nmargins around the list items. Dialogue: 0,0:00:23.39,0:00:26.86,Default,,0000,0000,0000,,Fortunately, it's easy to add\Nthis to the forecast list. Dialogue: 0,0:00:26.86,0:00:30.96,Default,,0000,0000,0000,,We can use dimensions to give the same\Nlayout more space in tablet layouts. Dialogue: 0,0:00:30.96,0:00:35.72,Default,,0000,0000,0000,,In forecast list item layout, we can add\Na padding dimension to the outer layout. Dialogue: 0,0:00:35.72,0:00:39.71,Default,,0000,0000,0000,,We use padding here instead of margin\Nbecause we just want the content in set. Dialogue: 0,0:00:39.71,0:00:40.58,Default,,0000,0000,0000,,If we used margin, Dialogue: 0,0:00:40.58,0:00:44.11,Default,,0000,0000,0000,,the row selector wouldn't be drawn\Nacross the entire list item. Dialogue: 0,0:00:44.11,0:00:47.97,Default,,0000,0000,0000,,We also use a different dimension for\Nthe space between the two temperatures. Dialogue: 0,0:00:47.97,0:00:49.48,Default,,0000,0000,0000,,Note that we use both right and Dialogue: 0,0:00:49.48,0:00:52.26,Default,,0000,0000,0000,,end to make sure that this layout is\Nready for right to left mirroring. Dialogue: 0,0:00:53.34,0:00:56.11,Default,,0000,0000,0000,,So then in our resource's file we\Ncreate a dimension that updates Dialogue: 0,0:00:56.11,0:00:58.86,Default,,0000,0000,0000,,the extra padding and\Nthe space between the two temperatures. Dialogue: 0,0:00:58.86,0:01:00.67,Default,,0000,0000,0000,,And that layout is updated. Dialogue: 0,0:01:00.67,0:01:03.43,Default,,0000,0000,0000,,I'm using sw600dp-port. Dialogue: 0,0:01:03.43,0:01:07.10,Default,,0000,0000,0000,,Which means that these changes will\Nonly be applied Portrait Orientation Dialogue: 0,0:01:07.10,0:01:10.13,Default,,0000,0000,0000,,with devices and a view sides\Nwith at least a width of 600 dp. Dialogue: 0,0:01:10.13,0:01:14.89,Default,,0000,0000,0000,,The second thing we take advantage of\Nis Layout Reuse using the include tag. Dialogue: 0,0:01:14.89,0:01:16.43,Default,,0000,0000,0000,,We can see that our portrait and Dialogue: 0,0:01:16.43,0:01:19.84,Default,,0000,0000,0000,,landscape detail fragment\Nuse the same views. Dialogue: 0,0:01:19.84,0:01:22.73,Default,,0000,0000,0000,,The fragment detail view contains\Nthese included lay outs already. Dialogue: 0,0:01:22.73,0:01:26.52,Default,,0000,0000,0000,,Note that we can assign new lay out\Nparameters when we include the lay out. Dialogue: 0,0:01:27.53,0:01:29.31,Default,,0000,0000,0000,,We're not using this in sunshine. Dialogue: 0,0:01:29.31,0:01:32.15,Default,,0000,0000,0000,,But we can avoid adding an extra\Ncontainer when we include the layout by Dialogue: 0,0:01:32.15,0:01:34.90,Default,,0000,0000,0000,,using the merge tag in\Nthe layout to be included. Dialogue: 0,0:01:34.90,0:01:37.81,Default,,0000,0000,0000,,Finally, we're going to\Ncontinue to make use of Refs. Dialogue: 0,0:01:37.81,0:01:40.93,Default,,0000,0000,0000,,Refs allow us to make aliases for\Nresources. Dialogue: 0,0:01:40.93,0:01:43.15,Default,,0000,0000,0000,,As you can see,\Nin tablet landscape mode, Dialogue: 0,0:01:43.15,0:01:46.25,Default,,0000,0000,0000,,the detail view should point to\Na vertical version of the view. Dialogue: 0,0:01:46.25,0:01:50.85,Default,,0000,0000,0000,,We're going to create a Ref that\Npoints to fragment_detail_start and Dialogue: 0,0:01:50.85,0:01:54.72,Default,,0000,0000,0000,,make sure that it points to the correct\Ndetail fragment for all configurations. Dialogue: 0,0:01:54.72,0:01:56.29,Default,,0000,0000,0000,,This will come in handy\Nin the next lecture.