1 00:00:04,960 --> 00:00:07,059 Alright, so let's make our code do a 2 00:00:07,059 --> 00:00:09,820 little bit more. Now, currently our layout 3 00:00:09,820 --> 00:00:12,400 contains three widgets. So I'm going to 4 00:00:12,400 --> 00:00:14,320 add some variables to store a reference 5 00:00:14,320 --> 00:00:16,329 to those widgets, so that we can do 6 00:00:16,329 --> 00:00:18,970 things with them in the code. Now at this 7 00:00:18,970 --> 00:00:20,260 point, I should point out that there are 8 00:00:20,260 --> 00:00:22,660 better ways to do what we're about to do, 9 00:00:22,660 --> 00:00:24,400 and you'll be seeing those in the next 10 00:00:24,400 --> 00:00:26,890 section, but it's important to understand 11 00:00:26,890 --> 00:00:28,300 what's really going on when you use 12 00:00:28,300 --> 00:00:30,610 those other techniques. They still do, 13 00:00:30,610 --> 00:00:32,009 basically, what we're about to do here. 14 00:00:32,009 --> 00:00:34,600 The difference is that Kotlin has some 15 00:00:34,600 --> 00:00:36,550 extensions that make coding it all a bit 16 00:00:36,550 --> 00:00:38,890 simpler. So please don't take this next 17 00:00:38,890 --> 00:00:41,920 bit of code as the definitive way to do things. 18 00:00:41,920 --> 00:00:44,410 In Kotlin, there are easier ways to do this, 19 00:00:44,410 --> 00:00:46,480 but I think it's important to understand 20 00:00:46,480 --> 00:00:48,190 what's really going on, so we're going 21 00:00:48,190 --> 00:00:50,079 to do it the quote-unquote longhand way, 22 00:00:50,079 --> 00:00:52,750 if you like, here. Now it's also far easier 23 00:00:52,750 --> 00:00:54,160 to understand what this code's doing, 24 00:00:54,160 --> 00:00:55,989 and that's because there's very little 25 00:00:55,989 --> 00:00:58,660 magic. Now the methods that we'll use 26 00:00:58,660 --> 00:01:01,270 later, and for the rest of the course, do 27 00:01:01,270 --> 00:01:03,850 rely on behind the scenes magic to make 28 00:01:03,850 --> 00:01:06,070 the code simpler, but if I started with that 29 00:01:06,070 --> 00:01:07,780 you wouldn't really know what was 30 00:01:07,780 --> 00:01:09,820 happening under the hood. So we'll go 31 00:01:09,820 --> 00:01:11,680 ahead now and add three lines of code, so 32 00:01:11,680 --> 00:01:13,450 I'm going to start by putting this under 33 00:01:13,450 --> 00:01:15,520 the line 6, under the class Main 34 00:01:15,520 --> 00:01:17,490 Activity line, and I'm gonna start with 35 00:01:17,490 --> 00:01:25,320 private space var space editText space 36 00:01:25,320 --> 00:01:29,770 : then EditText with a capital E, Edit 37 00:01:29,770 --> 00:01:34,180 Text? equals null, making 38 00:01:34,180 --> 00:01:36,100 sure you get your capitalization correct 39 00:01:36,100 --> 00:01:39,159 with this. Next line, private space var 40 00:01:39,159 --> 00:01:44,710 space button: then capital B this 41 00:01:44,710 --> 00:01:46,990 time for Button again, question mark 42 00:01:46,990 --> 00:01:51,009 equals null. Then on the third line, 43 00:01:51,009 --> 00:01:55,060 private var, this time it's textView, 44 00:01:55,060 --> 00:01:59,079 text with a capital V for View colon and a 45 00:01:59,079 --> 00:02:01,329 capital T for TextView, so I'll repeat 46 00:02:01,329 --> 00:02:04,770 that word, question mark equals null. 47 00:02:04,770 --> 00:02:06,939 Alright, so at this point now we've got 48 00:02:06,939 --> 00:02:09,970 three properties. Now editText with a 49 00:02:09,970 --> 00:02:11,980 lowercase e, and you can see that on line 50 00:02:11,980 --> 00:02:14,260 10, well that can store a reference to an 51 00:02:14,260 --> 00:02:16,870 editText widget. And notice that the 52 00:02:16,870 --> 00:02:18,460 capitalization of the 53 00:02:18,460 --> 00:02:20,230 two words there, and that's actually very 54 00:02:20,230 --> 00:02:22,150 important that you do pay attention to 55 00:02:22,150 --> 00:02:24,940 that, to the cases of names in Kotlin. 56 00:02:24,940 --> 00:02:26,980 EditText with a capital E isn't the same 57 00:02:26,980 --> 00:02:29,740 as editText with a lowercase e. Now with 58 00:02:29,740 --> 00:02:33,220 a capital E, EditText is a class, so it 59 00:02:33,220 --> 00:02:34,960 represents the type of object that we're 60 00:02:34,960 --> 00:02:37,030 going to be dealing with. Now if we look 61 00:02:37,030 --> 00:02:39,610 at the import section, up here on the top, 62 00:02:39,610 --> 00:02:40,870 now I'll just scroll up so we can see all the 63 00:02:40,870 --> 00:02:43,540 code, we can see here that EditText 64 00:02:43,540 --> 00:02:45,580 has been added and it's coming from the 65 00:02:45,580 --> 00:02:48,640 android.widget package. So EditText, 66 00:02:48,640 --> 00:02:51,060 effectively, is a widget, and similarly 67 00:02:51,060 --> 00:02:54,250 Button is a button widget and TextView 68 00:02:54,250 --> 00:02:57,670 is a textview widget. Now editText with 69 00:02:57,670 --> 00:03:00,280 a lowercase e is a property that can 70 00:03:00,280 --> 00:03:03,070 store a reference to a widget. We can 71 00:03:03,070 --> 00:03:04,930 create a new widget and refer to it 72 00:03:04,930 --> 00:03:08,080 using the name editText or, and this is 73 00:03:08,080 --> 00:03:10,120 what we'll be doing here, we can find the 74 00:03:10,120 --> 00:03:12,190 editText widget in our layout and 75 00:03:12,190 --> 00:03:15,190 assign it to the editText property, so 76 00:03:15,190 --> 00:03:16,660 that we can refer to the widget that's 77 00:03:16,660 --> 00:03:18,310 been created when the layout was 78 00:03:18,310 --> 00:03:21,490 inflated. Now for some reason, Google 79 00:03:21,490 --> 00:03:23,350 referred to an editText widget in the 80 00:03:23,350 --> 00:03:26,410 designer as Plain Text, but it's typing 81 00:03:26,410 --> 00:03:28,810 code is editText. So we can search the 82 00:03:28,810 --> 00:03:30,280 layout for our Plain Text widget 83 00:03:30,280 --> 00:03:32,470 and refer to it via the field edit 84 00:03:32,470 --> 00:03:34,450 Text, and we can also do the same with a 85 00:03:34,450 --> 00:03:36,850 Button than the TextView as well. So we 86 00:03:36,850 --> 00:03:39,000 come back and open the layout 87 00:03:39,000 --> 00:03:43,090 design view, and if I click on some of 88 00:03:43,090 --> 00:03:44,410 these things here, you see we've got a Text 89 00:03:44,410 --> 00:03:45,730 View there over to the left hand side, 90 00:03:45,730 --> 00:03:48,790 and then a text, we've got Plain Text 91 00:03:48,790 --> 00:03:51,550 there. But essentially, Plain Text is the 92 00:03:51,550 --> 00:03:54,360 editText that we're referring to here. 93 00:03:54,360 --> 00:03:56,850 Alright, and back to our Kotlin class. 94 00:03:56,850 --> 00:03:58,930 Alright, so we've also done the same with 95 00:03:58,930 --> 00:04:00,340 the Button and the TextView, so we've now 96 00:04:00,340 --> 00:04:02,860 got three properties that we've created 97 00:04:02,860 --> 00:04:05,320 here. And incidentally, it's very common 98 00:04:05,320 --> 00:04:07,090 in Kotlin, to give the field the same 99 00:04:07,090 --> 00:04:09,880 name as it's type or class, but with a 100 00:04:09,880 --> 00:04:12,460 lower case initial letter. Now if we had 101 00:04:12,460 --> 00:04:14,230 several editText widgets in the layout, 102 00:04:14,230 --> 00:04:15,790 then we'd have to give them more 103 00:04:15,790 --> 00:04:17,858 meaningful names such as address text 104 00:04:17,858 --> 00:04:20,589 perhaps, or name text and so on, but 105 00:04:20,589 --> 00:04:22,060 as there's only one type of each type 106 00:04:22,060 --> 00:04:24,130 of widget, I'll just use these names for 107 00:04:24,130 --> 00:04:26,320 the Button and the TextView. But just so 108 00:04:26,320 --> 00:04:27,700 there's no confusion though, what I'm going 109 00:04:27,700 --> 00:04:31,870 to do is rename the editText field to user input. 110 00:04:31,870 --> 00:04:33,310 You'll see why in a minute, when we have 111 00:04:33,310 --> 00:04:34,990 the word button three times on the same 112 00:04:34,990 --> 00:04:36,940 line or with different meanings. 113 00:04:36,940 --> 00:04:39,070 So let's just go to line 10 and just change this 114 00:04:39,070 --> 00:04:40,360 editText, and I'm going to change that 115 00:04:40,360 --> 00:04:43,330 to userInput, userInput with a capital 116 00:04:43,330 --> 00:04:46,650 I for Input, the rest in lowercase. 117 00:04:46,650 --> 00:04:49,480 Now another thing to note is that you 118 00:04:49,480 --> 00:04:51,700 have to initialize variables in Kotlin. 119 00:04:51,700 --> 00:04:53,920 Now we don't yet know what values to 120 00:04:53,920 --> 00:04:56,140 assign to these properties, because we 121 00:04:56,140 --> 00:04:57,520 can't look them up in the layout until 122 00:04:57,520 --> 00:05:00,160 after that setContentView function's been 123 00:05:00,160 --> 00:05:02,430 executed. This is the one here on line 16. 124 00:05:02,430 --> 00:05:05,080 Until then there's no layout, which means 125 00:05:05,080 --> 00:05:07,240 that widgets don't yet exist. So therefore, 126 00:05:07,240 --> 00:05:09,760 I'm actually initializing all three 127 00:05:09,760 --> 00:05:11,890 properties to null to start with, in our 128 00:05:11,890 --> 00:05:14,770 declarations on line 10 through 12. So 129 00:05:14,770 --> 00:05:16,150 this means we have to declare them as 130 00:05:16,150 --> 00:05:18,430 nullable types, and that's what the 131 00:05:18,430 --> 00:05:21,150 question mark after the type means. 132 00:05:21,150 --> 00:05:23,680 Alright, so how do we link these fields 133 00:05:23,680 --> 00:05:25,540 up with the widgets in the layout. 134 00:05:25,540 --> 00:05:27,970 Well, the Android framework provides a 135 00:05:27,970 --> 00:05:30,610 method called findViewById, that's 136 00:05:30,610 --> 00:05:32,590 used to check a layout to fetch a widget 137 00:05:32,590 --> 00:05:35,230 with a particular ID from it. Now if you 138 00:05:35,230 --> 00:05:37,080 remember from when we were creating this 139 00:05:37,080 --> 00:05:39,700 interface, we made sure that each widget 140 00:05:39,700 --> 00:05:42,310 had an ID, and we removed the numbers from 141 00:05:42,310 --> 00:05:44,200 the ends in the IDs because they weren't 142 00:05:44,200 --> 00:05:47,110 necessary. It's actually those IDs that 143 00:05:47,110 --> 00:05:49,690 we use when calling findViewById, so 144 00:05:49,690 --> 00:05:51,340 I'm going to type the code in first and 145 00:05:51,340 --> 00:05:53,110 then we'll go through it. So I'm gonna come 146 00:05:53,110 --> 00:05:55,600 down here, below the setContentView line. 147 00:05:55,600 --> 00:05:59,020 I'm going to type in userInput is 148 00:05:59,020 --> 00:06:03,310 equal to findViewById, less than sign, 149 00:06:03,310 --> 00:06:05,500 then EditText with a capital E and a 150 00:06:05,500 --> 00:06:08,800 capital T and a greater than sign. Then 151 00:06:08,800 --> 00:06:10,300 in parentheses we're going to type in 152 00:06:10,300 --> 00:06:13,450 R.id, capital R that was, and 153 00:06:13,450 --> 00:06:17,230 then lowercase id.editText. Press 154 00:06:17,230 --> 00:06:19,240 ENTER there. Then on the next line we're 155 00:06:19,240 --> 00:06:22,450 going to type button equals findViewById 156 00:06:22,450 --> 00:06:26,710 and I can type the less than sign 157 00:06:26,710 --> 00:06:28,090 again, this time it's going to be Button 158 00:06:28,090 --> 00:06:30,550 and a greater than sign. Then in 159 00:06:30,550 --> 00:06:35,590 parentheses, R.id.button, then last 160 00:06:35,590 --> 00:06:41,020 line, textView. Notice as I'm typing, Android 161 00:06:41,020 --> 00:06:43,210 Studio is helpfully trying to give us some 162 00:06:43,210 --> 00:06:44,710 shortcuts, so I could just press ENTER to 163 00:06:44,710 --> 00:06:45,670 select those to save 164 00:06:45,670 --> 00:06:48,790 a bit of time, and less then sign again, Text 165 00:06:48,790 --> 00:06:51,730 View, greater than sign then parentheses 166 00:06:51,730 --> 00:06:58,660 again, R.id.textView. Okay. 167 00:06:58,660 --> 00:07:00,580 So you can see that those three lines 168 00:07:00,580 --> 00:07:03,130 are very similar. They each call the find 169 00:07:03,130 --> 00:07:05,440 ViewById method to find what's called 170 00:07:05,440 --> 00:07:07,930 a view. Now I think I mentioned, in an 171 00:07:07,930 --> 00:07:09,960 earlier video, that all widgets are Views. 172 00:07:09,960 --> 00:07:12,760 So a View in Android is the class that 173 00:07:12,760 --> 00:07:15,850 all widgets extend, so all widgets share 174 00:07:15,850 --> 00:07:17,950 some common behavior, such as being able 175 00:07:17,950 --> 00:07:20,290 to be placed in a layout and having size 176 00:07:20,290 --> 00:07:23,080 etc. But different widgets extend View in 177 00:07:23,080 --> 00:07:24,610 different ways to provide their own 178 00:07:24,610 --> 00:07:27,700 specific functionality. So an editText 179 00:07:27,700 --> 00:07:30,280 is a View that you can type into and a 180 00:07:30,280 --> 00:07:31,840 textView is a View designed for 181 00:07:31,840 --> 00:07:34,840 displaying text, for example. So findView 182 00:07:34,840 --> 00:07:37,360 ById returns a view object, and we have 183 00:07:37,360 --> 00:07:39,850 to tell Kotlin what type we really want 184 00:07:39,850 --> 00:07:41,440 before assigning the results to our 185 00:07:41,440 --> 00:07:43,810 properties. The View with your ID edit 186 00:07:43,810 --> 00:07:46,030 Text is an editText. I'd have to 187 00:07:46,030 --> 00:07:48,100 specify that that is the kind of object 188 00:07:48,100 --> 00:07:50,230 we expected before we can assign it to 189 00:07:50,230 --> 00:07:53,050 the userInput field on line 18, and the 190 00:07:53,050 --> 00:07:55,270 same for button and textView. 191 00:07:55,270 --> 00:07:56,890 So hopefully now, you can see why I renamed 192 00:07:56,890 --> 00:07:59,590 the editText to a userInput now. It 193 00:07:59,590 --> 00:08:01,780 could get very confusing otherwise. Now 194 00:08:01,780 --> 00:08:04,600 on line 19, the first button refers to 195 00:08:04,600 --> 00:08:06,970 the property and button surrounded by 196 00:08:06,970 --> 00:08:08,610 the less than than the greater than sign, 197 00:08:08,610 --> 00:08:12,040 here, well that refers to the type of 198 00:08:12,040 --> 00:08:14,110 object that we want the view to 199 00:08:14,110 --> 00:08:16,420 be treated as, before we can assign it to 200 00:08:16,420 --> 00:08:18,700 the property. And finally, the last user 201 00:08:18,700 --> 00:08:20,190 button over here to the right-hand side, 202 00:08:20,190 --> 00:08:23,440 that refers to the ID of the button that 203 00:08:23,440 --> 00:08:26,080 we used in the layout. Now on line 18, 204 00:08:26,080 --> 00:08:28,380 we can see that they're different things. 205 00:08:28,380 --> 00:08:30,760 There we looked for an EditText widget 206 00:08:30,760 --> 00:08:32,950 with the ID editText, that's with the 207 00:08:32,950 --> 00:08:35,919 edit with a lowercase e, then assigning 208 00:08:35,919 --> 00:08:37,870 the reference to its property called 209 00:08:37,870 --> 00:08:40,479 userInput. Alright, so the last thing 210 00:08:40,479 --> 00:08:43,120 to look at is the way the IDs themselves, 211 00:08:43,120 --> 00:08:45,940 have been specified. Now it's easy to see 212 00:08:45,940 --> 00:08:47,650 how they relate to the IDS we gave to 213 00:08:47,650 --> 00:08:50,230 the widgets in a previous video, but what 214 00:08:50,230 --> 00:08:54,070 is this R dot id dot all about. Well if 215 00:08:54,070 --> 00:08:55,840 you remember, when we set the IDS in the 216 00:08:55,840 --> 00:08:59,570 layout, we used a plus to tell Android Studio that 217 00:08:59,570 --> 00:09:01,730 this is the, this is where the IDs were being 218 00:09:01,730 --> 00:09:04,400 created, and that causes Android Studio 219 00:09:04,400 --> 00:09:06,350 to create a class that it calls R, 220 00:09:06,350 --> 00:09:08,660 capital R, where it stores all the 221 00:09:08,660 --> 00:09:11,360 information on resources in the app. So 222 00:09:11,360 --> 00:09:13,570 in other words, R here is for resources. 223 00:09:13,570 --> 00:09:15,680 Now there's a really cool feature of 224 00:09:15,680 --> 00:09:17,480 Android Studio that lets you jump to 225 00:09:17,480 --> 00:09:19,700 where something's defined, by holding 226 00:09:19,700 --> 00:09:21,620 down the ctrl key, or the command key on 227 00:09:21,620 --> 00:09:23,600 a Mac, when you click the 228 00:09:23,600 --> 00:09:26,360 item. So if I come over here and click on, 229 00:09:26,360 --> 00:09:28,490 and command click the editText, again 230 00:09:28,490 --> 00:09:31,010 control click on a PC, so over here 231 00:09:31,010 --> 00:09:32,120 on line 18, 232 00:09:32,120 --> 00:09:35,090 click on that, you can see I get taken 233 00:09:35,090 --> 00:09:37,340 straight to the XML for the layout where 234 00:09:37,340 --> 00:09:39,500 the editText is defined. Now that's 235 00:09:39,500 --> 00:09:40,700 really useful and we're going to be 236 00:09:40,700 --> 00:09:43,070 using that a lot in this course, to check 237 00:09:43,070 --> 00:09:45,470 out all sorts of things. So what you can 238 00:09:45,470 --> 00:09:46,760 see now, now that I've clicked that, is 239 00:09:46,760 --> 00:09:48,530 that the ID really is referring to the 240 00:09:48,530 --> 00:09:52,190 widget in our layout. Now the R class is 241 00:09:52,190 --> 00:09:54,170 created automatically by Android Studio 242 00:09:54,170 --> 00:09:57,650 to store all resources, as I said, and we 243 00:09:57,650 --> 00:09:59,420 can have a quick look at that. Now I'm 244 00:09:59,420 --> 00:10:01,010 just showing you this to explain what's 245 00:10:01,010 --> 00:10:02,270 going on here and I wouldn't normally 246 00:10:02,270 --> 00:10:04,970 edit the the R class, and you certainly 247 00:10:04,970 --> 00:10:06,740 shouldn't be going about 248 00:10:06,740 --> 00:10:09,590 making any changes to it. And in fact, 249 249 00:10:09,590 --> 00:10:11,240 Android Studio doesn't even show the R 250 00:10:11,240 --> 00:10:13,490 class in the project pane when it's in 251 00:10:13,490 --> 00:10:15,650 Android view. What I'm going to do is 252 00:10:15,650 --> 00:10:17,600 come over here and click on project view, 253 00:10:17,600 --> 00:10:20,480 and once I do that we get some other 254 00:10:20,480 --> 00:10:22,130 options if I expand the window out again, 255 00:10:22,130 --> 00:10:24,260 and what I'm going to do is come down 256 00:10:24,260 --> 00:10:26,660 here because, basically, project view is 257 00:10:26,660 --> 00:10:28,640 giving us a list of all the files in 258 00:10:28,640 --> 00:10:30,560 the project, even the ones we shouldn't 259 00:10:30,560 --> 00:10:32,990 be messing with or changing. So under app, 260 00:10:32,990 --> 00:10:36,040 I'm going to click on app then build, 261 00:10:36,040 --> 00:10:42,620 generated then source then r, lowercase r 262 00:10:42,620 --> 00:10:45,410 there, then debug. These are all files and 263 00:10:45,410 --> 00:10:46,840 folders created automatically by 264 00:10:46,840 --> 00:10:49,850 Android Studio for us. Then we're going to 265 00:10:49,850 --> 00:10:51,050 go into this academy.learn 266 00:10:51,050 --> 00:10:53,270 programming.buttoncounter app. Expand 267 00:10:53,270 --> 00:10:55,970 that out, and here now we've got this R class. 268 00:10:55,970 --> 00:10:57,560 I'm just going to double click that. Now 269 00:10:57,560 --> 00:11:00,050 again, there's no reason for you to edit 270 00:11:00,050 --> 00:11:01,730 this file, and in fact, you can see at the 271 00:11:01,730 --> 00:11:04,100 top there, there's actually a warning that the 272 00:11:04,100 --> 00:11:05,660 file shouldn't be edited. 273 00:11:05,660 --> 00:11:08,120 Now as I scroll through, you can 274 00:11:08,120 --> 00:11:09,620 see there's quite a bit of information 275 00:11:09,620 --> 00:11:12,230 in here, and it really creates all sorts 276 00:11:12,230 --> 00:11:13,430 of things that don't 277 00:11:13,430 --> 00:11:15,410 probably make a lot of sense, and it's 278 00:11:15,410 --> 00:11:17,480 all stuff that Android needs in order to 279 00:11:17,480 --> 00:11:19,700 build the app and to track all the 280 00:11:19,700 --> 00:11:21,339 various components of the application. 281 00:11:21,339 --> 00:11:23,600 Now rather than trying to find the ID 282 00:11:23,600 --> 00:11:25,880 section by scrolling, I'm going to search 283 00:11:25,880 --> 00:11:30,470 for class ID, just doing a search and 284 00:11:30,470 --> 00:11:33,470 typing class space id, and there it is 285 00:11:33,470 --> 00:11:35,510 there, in my case, on line 2694 286 00:11:35,510 --> 00:11:36,830 but it might be a different line 287 00:11:36,830 --> 00:11:39,200 number for you. Now looking through this 288 00:11:39,200 --> 00:11:42,320 class here, contains all sorts of IDs with 289 00:11:42,320 --> 00:11:43,850 the identification numbers that Android 290 00:11:43,850 --> 00:11:46,130 Studio has given them. Now most of these 291 00:11:46,130 --> 00:11:48,200 aren't used so they won't appear in the 292 00:11:48,200 --> 00:11:50,899 final compiled version of the app, but if 293 00:11:50,899 --> 00:11:51,920 we scroll down and have a look here, we 294 00:11:51,920 --> 00:11:55,820 can see that our button's there, button is 295 00:11:55,820 --> 00:11:58,880 there. We've also got an editText 296 00:11:58,880 --> 00:12:01,399 showing here, and we should be able to 297 00:12:01,399 --> 00:12:05,450 see the textViews as well, with a bit of scrolling. 298 00:12:05,450 --> 00:12:07,960 You can see there's a textview there as well. 299 00:12:07,960 --> 00:12:11,000 So these are in a class called ID, 300 00:12:11,000 --> 00:12:13,940 inside another class called R, so 301 00:12:13,940 --> 00:12:16,760 which is why now, when I close this, you can see 302 00:12:16,760 --> 00:12:18,290 now that's why we use - going back to our 303 00:12:18,290 --> 00:12:21,380 class - R.id. then whatever the 304 00:12:21,380 --> 00:12:23,420 name we want to reference. So that's the 305 00:12:23,420 --> 00:12:25,070 reason we're doing that. We're telling 306 00:12:25,070 --> 00:12:26,420 Android Studio where to look to find 307 00:12:26,420 --> 00:12:28,940 that particular reference, and the method 308 00:12:28,940 --> 00:12:32,360 wants the numeric ID, essentially. Alright, 309 00:12:32,360 --> 00:12:34,850 so I have digressed a lot here, but we 310 00:12:34,850 --> 00:12:36,230 were trying to connect the button up to 311 00:12:36,230 --> 00:12:38,600 some code. So let's end the video here, 312 00:12:38,600 --> 00:12:40,370 in the next one, we're going to start work 313 00:12:40,370 --> 00:12:45,130 on doing just that. So I'll see you in the next video.